Monday, April 2, 2012

Create a Single Database deployment script from the dbproj in Visual Studio



  1. Open the solution that contains the desired database project.  
  2. Right click on the database project and select properties.  
  3. Click the Deploy tab and verify the Deploy Action is set to "Create a deployment script (.sql) and deploy to the database, and the Target Database Settings are correct.  
  4. Now we need to update the .dbproj file to include the Deploy target.  From the Solution Explorer right click the database project and select "Unload Project".  
  5. Right click on the database project and select "Edit [database].dbproj" where [database] equals the name of your database project. This will open the .dbproj with an XML editor.  
  6. Update the DefaultTargets attribute of the Project element to "Build;Deploy".  
  7. Save and close the file then right click the database project and select "Reload Project".  
  8. Check in Build Output path, in this path single database deployment script will be created.
  9. Build your project to verify the script.


Thursday, March 22, 2012

Remove warning for Database related Project (Unresolved reference to object)



Adding Database reference:


http://blogs.msdn.com/b/gertd/archive/2009/06/10/system-objects-in-tempdb.aspx 


Simple Solution



The problem is the master.dbscema is not referenced by default (I can only assume because it doesn't make any assumptions about your database setup). So what you need to do is add it:


Open the database project.

  1. Select the "References" folder and right-click select "Add Database Reference".
  2. Add the reference to "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VSTSDB\Extensions\SqlServer\2008\DBSchemas\master.dbschema".
  3. all the warnings disappear.

Special Char in HTML/App.Config

Special Characters in HTML Code





Character


Html
Code




Description


"


"


quotation mark


&


&


ampersand


'


'


apostrophe 


< 


&lt;


less-than sign


> 


&gt;


greater-than sign

Tuesday, March 20, 2012

How to Enable 32-bit Applications on the IIS with Wix

In IIS6, this was a pain area. On a 64-bit Windows 2003 Server, you cannot run worker processes in both 32-bit mode and as well as 64 bit mode. Either only one of them was possible. But, in IIS7, you can run 32-bit and 64-bit worker processes simultaneously. Let’s see how to do it.



Right click on the Application Pool and select “Advanced Settings…” or select the same from the Actions pane after selecting the Application pool
Change the “Enable 32-bit Applications” to True (if you want the application pool to spawn in a 32-bit mode)
Click OK
Below is how you do from the AppCmd:
appcmd apppool set /apppool.name:MyAppPool32bit /enable32BitAppOnWin64:true
appcmd apppool set /apppool.name:MyAppPool32bit /enable32BitAppOnWin64:false
NOTE : By default, it is false.


Using Wix
 <CustomAction Id="SetAppPoolbit"

      Execute="deferred"
      Directory="TARGETDIR"
      ExeCommand="&quot;[WindowsFolder]system32\inetsrv\appcmd.exe&quot; set apppool /apppool.name:&quot;APPPoolName&quot; /enable32BitAppOnWin64:true"/>


Friday, March 16, 2012

Windows Service getting crashed without any errors in event logs


Error in the Windows Error Reports
FriendlyEventName=Stopped working
ConsentKey=CLR20r3
ReportDescription=Stopped working


Resolution
Add local Network Service into the admin group and problem will get resolved.