Monday, July 21, 2008

Restarting IIS Service , Installation of IIS after dot net

   This is a technical post that i guess most dot net developers might find useful. I was looking for this for a long time and had to do a lot of time wasting techniques to get stuff sorted out earlier.

   If you are trying to do some ASP.NET programming, and if for some reason installed the IIS Server (Internet Information Services) after installing Visual Studio, the web application would not run. I did this using Microsft Visual Studio.net 2003, so dont know about what differences there are in this respect with 2005 and 2008.

   In this scenario, i was told to uninsatll IIS and Visual Studio, restart the PC, Install IIS first and then the Visual Studio. This was so time consuming and this was the scenerio in our college lab. So most of my classmates had to do this tedious process when they had to run their mini projects. The problem was aggrevated with the lab having only 2 CD Drives.

  Ok, so whats the solution? There is an application called "Administration Utility". It manages the installation and uninstallation of multiple versions of ASP.NET on a single machine.

   Located in the directory "%windir%\Microsoft.NET\Framework\v1.1.4322", where %windir% points to your windows installation dirtectory like c:\winnt\ or d:\windows\

  If multiple versions of the framework are insatlled, you can see various directories in the Framework folder with the version numbers of the frameworks.

  Open up the command Prompt and reach this directory, use

      cd "%windir%\Microsoft.NET\Framework\v1.1.4322

at the command prompt to reach there.

Okay, now you need to invoke the application named "aspnet_regiis.exe". This is the administration utility and is command oriented.

If you type "aspnet_regiis" at the command prompt, it will display the syntax to use. Of them the first two may be of interest.

 -i - Install this version of ASP.NET and update scriptmaps
  at the IIS metabase root and for all scriptmaps below
  the root. Existing scriptmaps of lower version are
  upgraded to this version.

 -ir - Install this version of ASP.NET, register only. Do
  not update scriptmaps in IIS.

So you may use  

    aspnet_regiis -i

or

    aspnet_regiis -ir

to do the job.

Hope this has been useful, :)

No comments: