We would like to change a web site from version 1.1 to 2.0.50727 during the installation of a solution.
We would prefer a solution that could do this in code.
We can do this by running Aspnet_regiis -i . However, this has a drawback that it changes the version for all sites on the server, and the customer may have other sites that we should not change.
Is there a way to do this in code?
Is there a way to run Aspnet_regiis such that it only affects a single site on the web server?
-
Is there a way to run Aspnet_regiis such that it only affects a single site on the web server?
Yes.
Run
aspnet_regiis -?
and it will list all its options, including how to specify a virtual directory (it will include all child virtual directories as well). -
For a virtual directory use:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis /s W3SVC/1/ROOT/<YourVirtualDirectoryName>
Where 1 (W3SVC/1/ROOT) is the website id.
-
Found a similar question on stackoverflow with an answer that used code:
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.