加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 调用.NET 2 DLL的.NET 4应用程序是否有任何性能影响?

发布时间:2020-12-15 18:36:18 所属栏目:百科 来源:网络整理
导读:我找不到这个确切问题的答案,但有相关问题. 我们有编译为使用.NET 4的BIG WinForms应用程序.但是,我们调用的几个DLL和所有第三方控件都被编译为使用.NET 2.显然这有效,但是因为这有任何负面的性能问题场景,如果一切都使用.NET 4,它会更快. 我不是在尝试进行
我找不到这个确切问题的答案,但有相关问题.

我们有编译为使用.NET 4的BIG WinForms应用程序.但是,我们调用的几个DLL和所有第三方控件都被编译为使用.NET 2.显然这有效,但是因为这有任何负面的性能问题场景,如果一切都使用.NET 4,它会更快.

我不是在尝试进行微优化,但如果我能通过重新编译我拥有的源代码来获得微小/小的提升,那么我愿意付出努力,如果有收获的话.

解决方法

从理论上讲,不应对绩效产生任何重大影响.

The compatibility goal for the .Net Framework is that applications and components from previous versions should work smoothly on the .Net Framework 4…

当.NET 4.0应用程序加载.NET 2.0程序集时,它将使用兼容模式功能加载到4.0运行时,该功能有助于防止破坏:

In-Proc SxS does not solve the compatibility problems faced by library developers. Any libraries directly loaded by an application–either via a direct reference or an Assembly.Load–will continue to load directly into the runtime and AppDomain of the application loading it. This means that if an application is recompiled to run against the .NET Framework 4 runtime and still has dependent assemblies built against .NET 2.0,those dependents will load on the .NET 4 runtime as well. Therefore,we still recommend testing your libraries against all version[s] of the framework you wish to support. This is one of the reasons we have continued to maintain our high level of backward compatibility.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读