Apply a different ASP.NET runtime to your website without restarting IIS 6

If you have ever had to change the default asp.net runtime in IIS 6 you might have noticed that it warns you about restarting all of the other websites before it can be applied. On small servers with a handful of sites it's not a big deal. If you have a server that runs a lot of mission critical stuff it's more of a hassle.

Luckily there is an easy workaround for this. All you need to do it use the command line to specify the asp.net runtime you want to target and the IIS identifier you want to apply it to. So once you have setup your website in IIS open up the command prompt and type in:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -s w3svc/123456789/root -norestart

Simply replace the 123456789 numbers with the identifier value for your website. Usually this value is on the same line as your domain name in IIS 6. If it's not you can add the Identifier column from View -> Add/Remove.

The line should make sense just by looking at it. The first part is specifying the asp.net runtime you want to target (asp.net 4 in this example) next up we have the IIS identifier followed by a no restart flag.

It's a shame that you even have to do this at all but at least the option is straightforward enough not to make it too much of a burden.

blog comments powered by Disqus

Get In Touch

Follow me online at TwitterFacebook or Flickr.

Latest Tweets