IIS 为我的 AppPool 使用哪个版本的 .NET Framework?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37952860/
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
Which version of the .NET Framework is IIS using for my AppPool?
提问by Shakeer Hussain
.Net Framework 4.5 was installed on my machine and on the IIS Application Pool, I set the .NET CLR version to 4.0.
.Net Framework 4.5 安装在我的机器和 IIS 应用程序池上,我将 .NET CLR 版本设置为 4.0。
My question is when running .NET code in this IIS site, which framework version is it using: 4.0 or 4.5 ?
我的问题是在这个 IIS 站点中运行 .NET 代码时,它使用的是哪个框架版本: 4.0 或 4.5 ?
Please see below screen shots.
请参阅下面的屏幕截图。




回答by ryancdotnet
The AppPool's .NET CLR Version is different from the .NET Framework Version.
AppPool 的 .NET CLR 版本与 .NET Framework 版本不同。
The .NET CLR Version 4.0 is the CLR base for the following .NET Framework Versions:
.NET CLR 4.0 版是以下 .NET Framework 版本的 CLR 基础:
- 4
- 4.5 (including 4.5.1 and 4.5.2)
- 4.6 (including 4.6.1 and 4.6.2 Preview)
- 4
- 4.5(包括4.5.1和4.5.2)
- 4.6(包括4.6.1和4.6.2预览)
So having a .NET CLR Version of 4.0 just means you support the above Frameworks, which will run under their deployed framework version.
因此,拥有 .NET CLR 版本 4.0 仅意味着您支持上述框架,这些框架将在其部署的框架版本下运行。
Source: https://docs.microsoft.com/en-us/dotnet/standard/clr#clr-versions
来源:https: //docs.microsoft.com/en-us/dotnet/standard/clr#clr-versions
Update Feb 2020:
2020 年 2 月更新:
Here is a full mapping of CLR to .NET Framework versions, based off this official documentation. https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies#version-information
这是基于此官方文档的 CLR 到 .NET Framework 版本的完整映射。 https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies#version-information
CLR 1.0
.NET Framework 1.0
CLR 1.0
.NET 框架 1.0
CLR 1.1
.NET Framework 1.1
CLR 1.1
.NET 框架 1.1
CLR 2.0
.NET Framework 2.0
.NET Framework 3.0
.NET Framework 3.5
CLR 2.0
.NET 框架 2.0
.NET 框架 3.0
.NET 框架 3.5
CLR 4
.NET Framework 4
.NET Framework 4.5
.NET Framework 4.5.1
.NET Framework 4.5.2
.NET Framework 4.6
.NET Framework 4.6.1
.NET Framework 4.6.2
.NET Framework 4.7
.NET Framework 4.7.1
.NET Framework 4.7.2
.NET Framework 4.8
CLR 4
.NET 框架 4
.NET 框架 4.5
.NET 框架 4.5.1
.NET 框架 4.5.2
.NET 框架 4.6
.NET 框架 4.6.1
.NET 框架 4.6.2
.NET 框架 4.7
.NET 框架 4.7.1
.NET 框架 4.7.2
.NET 框架 4.8
回答by Maheswaran j
Follow the below steps to get the .Net Version Used by IIS.
按照以下步骤获取 IIS 使用的 .Net 版本。
- Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
- On the Connections pane, expand the server node and click Application Pools.
- On the Application Pools page, select the application pool for which you want to specify a .NET Framework version, and then click Basic Settings in the Actions pane.
- In the Edit Application Pool dialog box, in the .NET Framework version list, Check the version of .Net Framework. -> Get this version
- Navigate to the Directory and check the details of the clr.dll-> C:\Windows\Microsoft.NET\Framework64\Version_got_from_step_4\clr.dll
- 打开 IIS 管理器。有关打开 IIS 管理器的信息,请参阅打开 IIS 管理器 (IIS 7)。
- 在连接窗格上,展开服务器节点并单击应用程序池。
- 在“应用程序池”页面上,选择要为其指定 .NET Framework 版本的应用程序池,然后在“操作”窗格中单击“基本设置”。
- 在“编辑应用程序池”对话框的 .NET Framework 版本列表中,检查 .Net Framework 的版本。-> 获取这个版本
- 导航到目录并检查 clr.dll-> C:\Windows\Microsoft.NET\Framework64\Version_got_from_step_4\clr.dll 的详细信息
Versions of .Net above 4.0 are being upgraded as in-place and the installed version can be checked in the registry path - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\release or version
4.0 以上的 .Net 版本正在就地升级,可以在注册表路径中检查安装的版本 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\release or version

