Finding a whole lot of nothing provoked me to write about something specific related to this topic.
The Problem
You have Internet Information Server (IIS) running and are missing the ASP.NET tab. In most cases, you could use “aspnet_regiis /lk” and find the unique name of the website and then use that name to issue “aspnet_regiis /sn <uniqueName>”. Only the script maps for the specified site are updated right? Well, not exactly because the /lk switch only lists virtual directories and you have multiple websites running on your box. Therefore you find yourself stuck at step one and thinking:
“Why do websites not show up when I run “aspnet_regiis /lk”. And furthermore, if they are not listed then how do I upgrade their scriptmaps to .NET 2.0?”
I actually have 15 websites running on my IIS server and only 8 results. Not to mention, the specific website I want to upgrade is not listed!
The Solution
First of all, forget about all the recommendations and posts you’ve read about hacking the registry to fix the missing ASP.NET tab or reinstalling IIS. It’s not worth it!
Instead, you can find the unique name needed for the aspnet_regiis command using IIS Administration Console. Once you have that unique name, you can shell out to the command line and run “aspnet_regiis /sn <uniqueName>” without a problem.
Step 1: Open IIS Administration Console and right click the website you would like to upgrade.
Step 2: Click on “Properties” in the “Enable Logging” group. The unique name you are looking for is located at the bottom of the Logging Properties dialog and embedded in the “Log file name”. Remember this number, you will need it for the next step!
Step 3: Open the command line and navigate to the .NET 2.0 framework directory. This is usually under “C:\Windows\Microsoft.NET\Framework\v2.0…”. Issue the “aspnet_regiis –sn <uniqueName>” command to upgrade the desired website to .NET 2.0. Keep in mind, the unique name from above needs a minor tweak to work. For example:
W3SVC1911477709 = /W3SVC/1911477709/Root
Notice you must include the forward slashes in the appropriate places and append /Root to the end. Then, aspnet_regiis will fully understand your request.
Step 4: Open your site in a browser. If it depends on .NET 2.0, 3.0, 3.5, or 3.5 SP1 you should be in good shape. Remember, you can’t verify the upgrade by using “aspnet_regiis /lk”. Your website will not be listed!
Additional Tip: You can find the same information by opening the metabase.xml file and doing a search for your friendly website name. The unique name is in a little bit different format, but you can massage it the same way we did the log file name above to get a compatible format for “aspnet_regiis /sn <uniqueName>”.
Conclusion
We found the unique name of a website running on our IIS server for use with the aspnet_regiis command. Having this unique name provides us the ability to leverage aspnet_regiis and a slew of other useful commands. We didn’t have to reinstall anything, we didn’t have to hack the registry and we accomplished our goal in this case of upgrading a specific website to .NET 2.0 or higher.
I sincerely hope this saves someone out there some time! Good luck and happy coding.