This post originated from an RSS feed registered with .NET Buzz
by Doug Thews.
Original Post: Running Multiple .NET Frameworks Side-by-Side
Feed Title: IlluminatiLand
Feed URL: http://apps5.oingo.com/apps/domainpark/domainpark.cgi?client=netw8744&s=JETBRAINS.COM
Feed Description: A technology blog for people enlightened enough to think for themselves
As multiple versions of the .NET Framework are released, you'll need to start running them side-by-side. As we all know, the CLR compiler stamps your application with the Framework version required to run the app. So, that version needs to be available.
The effects of not having the right framework are confusing in ASP.NET. If you install .NET v1.1 (v1.1.4322), it will automatically register all of your webs to run under v1.1. But, if you've got a web that was compiled for v1.0 (v1.0.3705), you'll get a 404 - Page Not Found error from IIS, which is really off base. So, I thought I'd write a section on how to maintain side-by-side versions of the .NET Framework for ASP.NET webs.
First, let's assume you started off with v1.0 of the .NET Framework. Then, you installed v1.1. So, now all web apps are registered to run under v1.1. If you want to set a web app back to run under v1.0, you'll need to run the aspnet_regiis.exe utility (available for all Frameworks). You can find this in the directory:
There are other versions of the framework (like .NET 2.0 and older beta versions), but those are strictly alpha/betas. I don't list them because if you have access to them, you're under NDA. But, they follow the same principle.
OK, so now you'll enter a command like this (once you've moved to the right directory):
Aspnet_regiis.exe s W3SVC/1/ROOT/MyVirtualWeb
"W3SVC/1/ROOT" tells REGIIS to start in the root directory of the 1st enumeration spot under the Windows web server W3SVC (you can find the enumerations under Web Sites in IIS Administration or by looking at the registry). "/MyVirtualWeb" tells the REGIIS utility to register the virtual web "MyVirtualWeb" with the specific framework. Keep in mind that we're talking virtual directory names and not physical directory names. Use the IIS Administration tool if you're not sure about the names of your virtual webs. The "-s" option means to perform the action on the web directory and all child directories. You can use the "-sn" option to perform the action on the directory alone.
Well, that's pretty much it for running side-by-side .NET Frameworks for ASP.NET webs. I've heard of several freeware tools written by .NET developers that put a GUI on this process. If I find a good copy, I'll post a follow-up here.