<p>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.</p>

<p>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?</p>

[{'answer_id': 64345, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>Find the directory for the version of .Net you want, for example;\nC:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\nGet a cmd prompt there and then run aspnet_regiis -i.\nFurther info @ <a href="http://weblogs.asp.net/owscott/archive/2006/05/30/ASPNet_5F00_regiis.exe-tool_2C00_-setting-the-default-version-without-forcing-an-upgrade-on-all-sites.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/owscott/archive/2006/05/30/ASPNet_5F00_regiis.exe-tool_2C00_-setting-the-default-version-without-forcing-an-upgrade-on-all-sites.aspx</a></p>\n\n<p>Ryan</p>\n'}, {'answer_id': 64367, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': False, 'text': "<p>Be warned, running aspnet_regiis -i will remap all of your IIS websites to 2.0. If you have existing 1.1 applications that you want to keep, run aspnet_regiis -ir instead. This will set 2.0 to be the default runtime for IIS, but it won't change the script mappings for existing sites.</p>\n"}, {'answer_id': 64552, 'author': 'KGreene', 'author_id': 8567, 'author_profile': 'https://Stackoverflow.com/users/8567', 'pm_score': 1, 'selected': False, 'text': '<p>Simple answer:  Open IIS Manager.  In navigation pane, find the .NET2 web site and right click on it.  Select "Properties".  Then select "ASP.NET" tab.  First dropdown on that screen gives you option to select a different version of .NET.</p>\n\n<p>Please be aware -- when I did this, all of the web sites on the web server stopped running.  Microsoft support told me that .NET1 and .NET2 should not be run from same general area (default web sites) of the web server.  Solution is to create an application pool on the web server for either .NET1 or .NET2 sites and then use that to isolate all sites running the "other" version of .NET. Instruction for creating an application pool can be found under "help" in IIS Manager.</p>\n\n<p>You can create just one application pool and put all sites with same .NET in the same pool <strong>or</strong> you can create an application pool for each application.  Your choice.</p>\n'}, {'answer_id': 68043, 'author': 'Tim', 'author_id': 10363, 'author_profile': 'https://Stackoverflow.com/users/10363', 'pm_score': 4, 'selected': False, 'text': '<p>As already mentioned by another, I reference this <a href="http://weblogs.asp.net/owscott/archive/2006/05/30/ASPNet_5F00_regiis.exe-tool_2C00_-setting-the-default-version-without-forcing-an-upgrade-on-all-sites.aspx" rel="noreferrer">post</a> whenever I need to change the .NET settings for a site.</p>\n\n<p>As for your question, the following steps (summarized from the linked post) should achieve what you need:</p>\n\n<ol>\n<li><p>Run <code>aspnet_regiis -lk</code> 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 <code>W3SVC/</code>.</p></li>\n<li><p>For all .NET 1.1 sites not explicitly listed by the previous command, you will need to force them to use .NET 1.1:</p>\n\n<ol>\n<li>Determine the Identifier ID of the site(s) which you want to force to use .NET 1.1. (Through the IIS 6 Manager, you can determine the Identifier of a site by clicking the "Web Sites" folder on the left side of the tool. On the right side, all your sites will be listed, and the Identifier column shows the ID.)</li>\n<li>From the .NET 1.1 framework folder, run <code>aspnet_regiis -sn W3SVC/&lt;Identifier ID&gt;/ROOT/</code> where <code>&lt;Identifier ID&gt;</code> is the ID of the site which you want to force to use .NET 1.1. </li>\n</ol></li>\n<li>Finally, change the root <code>W3SVC/</code> 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 <code>aspnet_regiis -sn W3SVC/</code>.</li>\n</ol>\n\n<p>You can run <code>aspnet_regiis -lk</code> again to verify your settings.</p>\n'}, {'answer_id': 264419, 'author': 'Robert Wagner', 'author_id': 10784, 'author_profile': 'https://Stackoverflow.com/users/10784', 'pm_score': 2, 'selected': False, 'text': '<p>The following will set the default website to ASP.NET 2.0:</p>\n\n<p>C:\\windows\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_regiis.exe -sn W3SVC/</p>\n\n<p>Child applications inherit the ASP.NET setting from the parent, so all children will have the new setting.</p>\n\n<p>Alternatively run as variation on this command after setting up the new application.</p>\n\n<p>Rob</p>\n'}]
['https://Stackoverflow.com/questions/64279', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']