[英]Can C# projects that have 4.7.2 target framework version run on .net 4.6.1
We have a C# project where the C# projects are compiled with TargetFrameworkVersion 4.7.2.我们有一个 C# 项目,其中 C# 项目是使用 TargetFrameworkVersion 4.7.2 编译的。 For example, in the csproj file this is specified --
例如,在 csproj 文件中,这是指定的——
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
The compiled and built exe is installed in a VM which has .net 4.6.1 installed.编译和构建的 exe 安装在安装了 .net 4.6.1 的 VM 中。 I see that installation is successful and the software is working fine.
我看到安装成功并且软件运行良好。 So can we safely say that projects built with 4.7.2 can execute when .netframework 4.6.1 installed.
所以我们可以肯定地说,使用 4.7.2 构建的项目可以在安装 .netframework 4.6.1 时执行。 Or are there any issues to look out for here ?
或者这里有什么需要注意的问题吗?
You can use supportedRuntime
element in your app.config
file, like您可以在
app.config
文件中使用supportedRuntime
元素,例如
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
</configuration>
It's possible, since they share the same CLR version 4.0.这是可能的,因为它们共享相同的 CLR 4.0 版。 But you'll probably get a runtime exception, if using any specific features from .NET 4.7.2.
但是,如果使用 .NET 4.7.2 中的任何特定功能,您可能会遇到运行时异常。 Have a look at this thread for more details
查看此线程以了解更多详细信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.