Thursday, April 16, 2009

Open IIS hosted Visual Studio project on a box without IIS

I recently experienced an occasion to open a project created in Visual Studio 2008 SP1 configured to use IIS on a different box that did not have IIS installed. The project would not open and a message box indicated it was because IIS was not installed on the machine. The problem was easy to solve, but it required making a manual edit to the vbproject file.

The quick fix was to create a new Web Application project on the workstation without IIS, open the <project_name>.vbproj file in Wordpad or another editor and copy the XML between the <WebProjectProperties> tags.

   1: <WebProjectProperties> 
   2:           <UseIIS>False</UseIIS> 
   3:           <AutoAssignPort>True</AutoAssignPort> 
   4:           <DevelopmentServerPort>1159</DevelopmentServerPort> 
   5:           <DevelopmentServerVPath>/</DevelopmentServerVPath> 
   8:           <IISUrl> 
   9:           </IISUrl> 
  10:           <NTLMAuthentication>False</NTLMAuthentication> 
  11:           <UseCustomServer>False</UseCustomServer> 
  12:           <CustomServerUrl> 
  13:           </CustomServerUrl> 
  14:           <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> 
  15:         </WebProjectProperties>

Open the <project_name>.vbproj file of the project that would not open without IIS and paste the copied XML into the appropriate place in the file. Voila! The project can now be opened on the PC without IIS installed.

Technorati Tags: