ASP.NET下实际使用的是什么版本的.NET framework
What version of .NET framework is actually used under ASP.NET
假设我的应用程序池设置为“4.0.30319”。在 Visual Studio 中,我的项目设置为“.NET Framework 4.6.2”。
在我的web.config里有一行:
<httpRuntime targetFramework="4.5" maxRequestLength="30720" executionTimeout="36000"/>
而且服务器运行ISS上居然安装了4.8
现在假设 4.7 中的行为发生了变化。我会在我的应用程序中看到新行为吗?
根据 docs:
If the version of the .NET Framework that the application was built against is present on the computer, the application runs on that version.
If the version of the .NET Framework that the application was built against is not present and a configuration file does not specify a version in a Element, the application runs on the latest version of the .NET Framework that is present on the computer.
If the version of the .NET Framework that the application was built against is not present and the configuration file specifies a version in a Element, the application runs on the latest version that is specified in the application configuration file and is present on the computer.
所以我会说 4.8,您始终可以使用以下方式以编程方式检查它:
Environment.Version
另外检查这个 。
假设我的应用程序池设置为“4.0.30319”。在 Visual Studio 中,我的项目设置为“.NET Framework 4.6.2”。
在我的web.config里有一行:
<httpRuntime targetFramework="4.5" maxRequestLength="30720" executionTimeout="36000"/>
而且服务器运行ISS上居然安装了4.8
现在假设 4.7 中的行为发生了变化。我会在我的应用程序中看到新行为吗?
根据 docs:
If the version of the .NET Framework that the application was built against is present on the computer, the application runs on that version.
If the version of the .NET Framework that the application was built against is not present and a configuration file does not specify a version in a Element, the application runs on the latest version of the .NET Framework that is present on the computer.
If the version of the .NET Framework that the application was built against is not present and the configuration file specifies a version in a Element, the application runs on the latest version that is specified in the application configuration file and is present on the computer.
所以我会说 4.8,您始终可以使用以下方式以编程方式检查它:
Environment.Version
另外检查这个