简体   繁体   English

.NET Framework和兼容性

[英].NET Framework and compatibility

We have a case where 2 .NET applications are running on the same computer, A is built for 4.6.1 and B is built for 4.5. 我们有一种情况,其中2个.NET应用程序在同一台计算机上运行,​​A是为4.6.1构建的,而B是为4.5构建的。 This means that we have to install .NET framework 4.6.1 for A but this breaks a certain part(printing) of application B. Application B will have to be fixed but in the meantime, how do we solve this? 这意味着我们必须为A安装.NET Framework 4.6.1,但这会破坏应用程序B的某些部分(打印)。必须修复应用程序B,但与此同时,我们该如何解决呢? I have read this article: https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/version-compatibility 我已经阅读了这篇文章: https : //docs.microsoft.com/zh-cn/dotnet/framework/migration-guide/version-compatibility

It states that I should set the supportedRuntime like this: 它指出我应该这样设置supportedRuntime:

<configuration>
   <startup>
      <supportedRuntime version="v2.0.50727" />
      <supportedRuntime version="v4.0" />
   </startup>
</configuration>

But will this really solve my problem? 但这真的能解决我的问题吗? Is 4.6.1 containing 4.5 as a whole as well? 4.6.1是否也包含4.5的整体?

You cannot run 4.5 on a machine with 4.6.1 installed. 您不能在装有4.6.1的计算机上运行4.5。 It doesn't make sense the question. 这个问题没有道理。 The 4.6.1 version of the .net framework will be loaded, since those are the only libraries you have installed. .net框架的4.6.1版本将被加载,因为这些是您已安装的唯一库。 4.6.1 is meant to have a library that has every function of the 4.5 library, but in practice 4.5 was a buggy piece of crap, and a lot of bugs were removed. 4.6.1的本意是拥有一个具有4.5库的所有功能的库,但实际上4.5是一个有问题的废话,许多错误已被删除。 Of course one man's bug is another man's feature.... 当然,一个人的错误是另一个人的特征。

So in short if you are using the 4.5 framework API, you have no problems. 简而言之,如果您使用的是4.5框架API,则不会有任何问题。

However if you are relying on a 4.5 bug, you are stuffed. 但是,如果您依赖于4.5错误,那么您就被塞满了。

More to the point, 4.5 is no longer supported. 更重要的是,不再支持4.5。

Update: .net Core v1.0 has gone live. 更新:.net Core v1.0已启用。

The framework for .net Core is deployed by nuget, so you can use multiple versions for that. .net Core的框架是由nuget部署的,因此您可以为此使用多个版本。 You could install .net 4.5 and .net Core 1.0 concurrently, and it might solve your problem. 您可以同时安装.net 4.5.net Core 1.0 ,这可能会解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM