Поделиться через


ASP.NET tab forces restart of W3SVC

If you change the version on the ASP.NET tab that comes with the 2.0 Framework, the entire W3SVC process restarts. If you make this type of change during a maintenance window, the impact may not be too bad, but if you have multiple application pools in IIS and need to make this type of change during the day, all the application pools will recycle.

You can avoid this problem by running the following commands. The first command configures the mappings in IIS and uses the -norestart command to tell aspnet_regiis to not restart the W3SVC service. The second command restarts the IIS Application Pool:

    1. %windir%\Microsoft.Net\Framework\<version>\aspnet_regiis -s <path> -norestart
    2. %windir%\system32\iisapp.vbs /a <app pool> -r

It's important to note that it is not supported to run both 1.1 and 2.0 framework in the same application pool. For example, you can't have /MyApp mapped to the 1.1 framework in an application pool called MyAppPool and also have /AnotherApp mapped to the 2.0 framework in the same application pool. The symptom you will see is a Server Application Unavailable message in the browser. You will also get the following event in the Application Event Log:

Event Type: ErrorEvent Source: ASP.NET 2.0.50727.0 <could also be 1.1.4322>Event ID: 1062Description:It is not possible to run two different versions of ASP.NET in the same IIS process. Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process.

This requires that you know the IIS metabase path to the app; something like /w3svc/1/root/myapp if the application is under Default Web Site. You also have to know the application pool which would require you to look it up in IIS.

I've attached a .vbs file that helps to automate this process. Feel free to modify it however you see fit. It takes in the name of the web site; i.e. "Default Web Site", the version of the framework you want to map, and the virtual path to the app you want to configure. It's much easier to remember "Default Web Site" or "Intranet", than it is to remember the instance number of 578954321 :)

Example command lines:

  •   Configure the Default Web Site for ASP.NET 2.0
    ASPNETMapping_norestart.vbs website "Default Web Site" version 2.0
  •   Configure the Default Web Site for ASP.NET 1.1
    ASPNETMapping_norestart.vbs website "Default Web Site" version 1.1
  •   Configures the /mywebapp application for ASP.NET 2.0
    ASPNETMapping_norestart.vbs website "Default Web Site" apppath "/mywebapp" version 2.0
  •   Configures the /anotherapp application on the web site named Intranet for 2.0
    ASPNETMapping_norestart.vbs website "Intranet" apppath "/anotherapp" version 2.0

Download the file here

ASPNETMapping_norestart.zip

Comments

  • Anonymous
    February 27, 2007
    The comment has been removed

  • Anonymous
    June 07, 2007
    Can you tell it what app pool you want the new app to be created in? ie If you have an existing one, and don't want to create a new one?

  • Anonymous
    April 22, 2008
    Recently we have discovered an issue with IIS Manager wherein changing settings in a certain way may

  • Anonymous
    April 22, 2008
    Recently we have discovered an issue with IIS Manager wherein changing settings in a certain way may

  • Anonymous
    February 07, 2012
    The comment has been removed