Lance
Lance

Reputation: 2933

Is there anyway I can set the Target ASP.NET version in my config file that affect the IIS settings?

Here's the scenario:

After installing the ASP.NET application (using install shield) in IIS6, when I right click on the ASP.NET page, went to properties then click on the ASP.NET tab, I can see that the version selected in the drop down is .NET 2.0 but my application needs to run at 4.0.

The workaround is to change it manually to 4.0. But that's not what I want. I want it to be set to 4.0 right after installation. Are there any way that I can set that to 4.0 though code or config file?

Upvotes: 0

Views: 66

Answers (1)

Mick Walker
Mick Walker

Reputation: 3847

As part of our deploy scripts, we execute batch commands on the server to change the version of ASP.NET used to the version required.

Here is a snippet which changes the version to 2.0 (by default all sites are created with 4.0):

%windir%\microsoft.net\framework\v2.0.50727\aspnet_regiis -s W3SVC/[iisnumber]/ROOT

Note: You asked for a IIS 6 solution, I am not sure if this will work on later versions.

Upvotes: 1

Related Questions