Monday, February 26, 2007

Registering ASP.NET in IIS

I've tripped over this issue a couple of times so I figure I'd offload it to my blog to free up some space in my head.


The short story:

If you've just installed a new web application to your IIS server and it uses ASP.NET and you're unable to view the web page (specifically you may instead be asked to save a file) then it may be because you need to (re)register ASP.NET with IIS.

You do so like this:

1. With a command window, get to the latest version of .net under
2. C:\Windows\Microsoft.Net\Framework\
3. Now run the following command: "net stop w3svc" to stop web services.
4. Then use "aspnet_regiis.exe -ua" to uninstall all instances of ASP.NET from IIS.
5. Follow with "aspnet_regiis.exe -i" to install ASP.NET into IIS.
6. Now restart web services with "net start w3svc".


You install the .NET Framework version x.y. However you didn't have IIS installed in Windows. Then you install a web application to your IIS server . Viewing the web app pages confusingly just doesn't work, dammit! Then you remember the magical register command and voila, birds start singing, sun beams out from behind the clouds and the world is a happy place once more. :)

MS have also documented the issue.

No comments: