If you ever installed a .NET 4.0 application on a Windows 2003 machine with IIS6 you most likely encountered the following error message when attempting to modify the ASP.NET version.
“Changing the Framework version requires a a restart of W3SVC service. Alternatively, you can change the Framework version without restarting the W3SVC service by running: aspnet_regiis.exe –norestart –s IIS-Virtual-Path”
Since sounds like exactly what I want to do, I don’t want to restart the W3SVC service just to change my framework version on my new application, now how do I get the IIS-Virtual-Path.
Open up a command prompt and navigate to C:\Windows\Microsoft.NET\Framework\v4.0.30319> and type aspnet_regiis.exe –lk list the full path for the IIS application.
Example:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -lk
W3SVC/ 1.1.4322.2470
W3SVC/1/ROOT/ 1.1.4322.2470
W3SVC/1/ROOT/SomePath/SomeFolder/ 1.1.4322.2470*note, if your new application is not listed simply copy the first portion to be used in the next step W3SVC/1/ROOT/
Copy down the root path of your new application you wish to change to .NET 4.0.
Back in the command prompt again and type aspnet_regiis.exe -norestart -s W3SVC/1/ROOT/SomePath/SomeFolder/
Example:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -norestart -s W3SVC/1/ROOT/OnlineBankingHelpers/SomeFolder/
Start registering ASP.NET (4.0.30319) recursively at W3SVC/1/ROOT/SomePath/SomeFolder/.
Finished registering ASP.NET (4.0.30319) recursively at W3SVC/1/ROOT/SomePath/SomeFolder/.
Now if you run aspnet_reggiis.exe –lk you can see the framework version changed without a restart of the root service.
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -lk
W3SVC/ 1.1.4322.2470
W3SVC/1/ROOT/ 1.1.4322.2470
W3SVC/1/ROOT/SomePath/SomeFolder/ 4.0.30319.0
-
markcoleman posted this