We create new sites in IIS 6 (Windows Server 2003) using IIS Manager. When these sites are created in IIS 6, the ASP.NET version defaults to ASP.NET 1.1. We would like it to default to ASP.NET 2.0. The reason this is a problem for us is that when you take any site on the server and switch the ASP.NET version from ASP.NET 1.1 to ASP.NET 2.0, all web sites recycle.
Is there a setting in the IIS metabase that controls this or a way to create a site via script that sets the ASP.Net version correctly so that we can avoid the IIS reset when setting up each site?
As already mentioned by another, I reference this post whenever I need to change the .NET settings for a site.
As for your question, the following steps (summarized from the linked post) should achieve what you need:
Run aspnet_regiis -lk
from any .NET framework folder to list your current settings to help you determine which sites should remain using .NET 1.1. If you know there is a .NET 1.1 site, but it is not explicitly listed by this command, then it is inheriting from the root W3SVC/
.
For all .NET 1.1 sites not explicitly listed by the previous command, you will need to force them to use .NET 1.1:
aspnet_regiis -sn W3SVC/<Identifier ID>/ROOT/
where <Identifier ID>
is the ID of the site which you want to force to use .NET 1.1. W3SVC/
to use .NET 2.0 so that all newly created sites will inherit from the root and default to use .NET 2.0. To change the root, from the .NET 2.0 framework folder, run aspnet_regiis -sn W3SVC/
.You can run aspnet_regiis -lk
again to verify your settings.