If you several different .Net frameworks installed on your machine, you will inevitably run into a situation where your .net 1.1 website wants to run under 2.0 framework or vice-versa and your code doesn’t work. Here are few quick steps to make your web site or virtual directory run under a specific .net framework.
UPDATE : There is a free tool that will do all the hardwork for you. It is called ASP.Net version switcher. ASPNETVersionSwitcher.exe
- Open Command Prompt and CD to any .Net Framework folder (1.1 or 2.0)·
- Run aspnet_regiis –lk. This will show you output like this. In this case all my websites are running under .net framework 2.0
- C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>aspnet_regiis -lk
- W3SVC/ 2.0.50727.42
- W3SVC/1/ROOT/ 2.0.50727.42
- W3SVC/1/ROOT/Site1/ 2.0.50727.42
- To make a site run under .Net 1.1 framework in this example, I will CD to the v1.1.4322 folder on my machine where .Net framework 1.1 resides.
- Run aspnet_regiis -SN w3svc/1/root/site1 – In my case Site1 is the name of the virtual dir
You will get a confirmation message and you are all set.