tags:

views:

94

answers:

1

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

+2  A: 

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"
CarlosAg