通过命令行更改IIS .NET Framework版本

时间:2012-06-29 14:35:29

标签: iis powershell

我正在研究一组脚本,以自动在Windows Server 2008 R2上安装和配置IIS。我对如何将IIS的默认服务器级.net框架版本从 v2.0.50727 编写为 v4.0.30319

进行了编写。

到目前为止,我大部分时间都在使用PowerShell(很好的借口强迫自己学习它)以及WebAdministration模块来执行所有配置。 PowerShell解决方案是首选,但不是必需的。

在IIS管理器中可以更改此位置的可视参考: enter image description here

1 个答案:

答案 0 :(得分:2)

You can run the following command from the cmd.exe prompt to change the IIS 7 setting.

C:\Windows\System32\inetsrv\appcmd.exe set config /section:system.applicationHost/applicationPools /applicationPoolDefaults.managedRuntimeVersion:"v4.0" /commit:apphost
相关问题