如何在 IIS 7 应用程序池中设置 .net Framework 4.5 版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9559372/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 16:17:57  来源:igfitidea点击:

How to set .net Framework 4.5 version in IIS 7 application pool

.netvisual-studioiis

提问by Gene Reddick

I installed the Visual Studio 11 Beta and suddenly all the async action methods I had created under the VS 11 Developer preview started hanging (apparently this issue: http://blogs.msdn.com/b/pfxteam/archive/2012/03/03/10277166.aspx).

我安装了 Visual Studio 11 Beta,突然我在 VS 11 Developer preview 下创建的所有异步操作方法开始挂起(显然这个问题:http: //blogs.msdn.com/b/pfxteam/archive/2012/03/ 03/10277166.aspx)。

My app is using v4.0.30319 as the Framework Version, but there is no option to use 4.5. I repaired my .net 4.5 install to be sure, but nothing. Is there a way to configure this in IIS? Do I need to bin deploy the files (and if so which)?

我的应用程序使用 v4.0.30319 作为框架版本,但没有使用 4.5 的选项。我修复了我的 .net 4.5 安装,但没有。有没有办法在 IIS 中配置它?我是否需要对文件进行 bin 部署(如果需要,是哪个)?

回答by Peter Kiss

There is no 4.5 application pool. You can use any 4.5 application in 4.0 app pool. The .NET 4.5 is "just" an in-place-update not a major new version.

没有 4.5 应用程序池。您可以使用 4.0 应用程序池中的任何 4.5 应用程序。.NET 4.5“只是”一个就地更新,而不是一个主要的新版本。

回答by Vitor Sousa

Go to "Run" and execute this:

转到“运行”并执行以下操作:

%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir

NOTE: run as administrator.

注意:以管理员身份运行。

回答by Walter

There is no v4.5 shown in the gui, and typically you don't need to manually specify v4.5 since it's an in-place update. However, you can set it explicitly with appcmd like this:

gui 中没有显示 v4.5,通常您不需要手动指定 v4.5,因为它是就地更新。但是,您可以像这样使用 appcmd 显式设置它:

appcmd set apppool /apppool.name: [App Pool Name] /managedRuntimeVersion:v4.5

Appcmd is located in %windir%\System32\inetsrv. This helped me to fix an issue with Web Deploy, where it was throwing an ERROR_APPPOOL_VERSION_MISMATCH error after upgrading from v4.0 to v4.5.

Appcmd 位于%windir%\System32\inetsrv. 这帮助我解决了 Web Deploy 的一个问题,它在从 v4.0 升级到 v4.5 后抛出了 ERROR_APPPOOL_VERSION_MISMATCH 错误。

MS article on setting .Net version for App Pool

关于为 App Pool 设置 .Net 版本的 MS 文章