blaster
blaster

Reputation: 8937

Changing Framework Version for an IIS 7 Virtual Directory from the Command Line

Is there a programmatic way from the command line to change the .NET Framework version for a particular virtual directory in IIS 7.0?

We're using the mkiisdir.exe tool from NAntContrib to create virtual directories, but we need to change the framework version to 4.0 for the newly created virtual directory. mkiisdir.exe doesn't appear to have options that allow this to be controlled.

We're looking for a way to do this either through mkiisdir.exe or another tool - whatever works.

Thanks in advance! Jeff

Upvotes: 1

Views: 1316

Answers (1)

Carlos Aguilar Mares
Carlos Aguilar Mares

Reputation: 13581

You could use AppCmd.exe to set the runtime version for the AppPool you create: So assuming that your application is using TestPool Application Pool, then you can:

appcmd.exe set config  -section:applicationPools /[name='TestPool'].managedRuntimeVersion:"v4.0"

Upvotes: 3

Related Questions