我的项目引用了 3 个不同版本的 mscorlib.dll

发布于 2024-10-03 08:36:23 字数 484 浏览 1 评论 0原文

我注意到我的一个项目引用了 3 个不同版本的 mscorlib:

  1. 1.0.5000.0
  2. 2.0.0.0
  3. 4.0.0.0

alt text

关于“ mscorlib.dll 和 System.dll”帮助我了解了 mscorlib 的用途,但我想知道应用程序需要此程序集的多个版本是否正常/必要。也许发生这种情况是因为我将项目从 VS 2005 升级到 VS 2010。

我可以让我的项目仅引用 4.0.0.0 版本的 mscorlib 吗?

I noticed that one of my projects references 3 different versions of mscorlib:

  1. 1.0.5000.0
  2. 2.0.0.0
  3. 4.0.0.0

alt text

This post about "mscorlib.dll & System.dll" helped me understand what mscorlib is for, but I'm wondering whether it's normal/necessary for an application to require multiple versions of this assembly. Perhaps this happened because I upgraded my project from VS 2005 to VS 2010.

Is it possible for me to make my project only reference the 4.0.0.0 version of mscorlib?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦中的蝴蝶 2024-10-10 08:36:23

造成这种结果的原因有很多。如果您只需要 v4.0,请确保

  • 从 VS 2010 中的新项目开始
  • 将所有现有代码文件导入到这个新项目中
  • 如果您有第三方参考
    (例如Oracle数据访问),确保
    您使用其 .Net v4.0 dll

或者,您可以删除对可能引用旧版本 mscorlib 的所有组件的引用。这可能是不可能的,因为所有供应商可能不会将其组件完全升级到 v 4.0

就我个人而言,我不会担心它们,除非它们是重大错误的根本原因(这不太可能)。

There are many reasons why you could end up like that. If you only want v4.0, make sure you

  • Start with a fresh project in VS 2010
  • Import all your existing code files into this new project
  • If you have third party references
    (such Oracle data access), make sure
    you use their .Net v4.0 dlls

Alternatively, you can remove references to all components that might be referencing older versions of mscorlib. This may not be possible as all vendors may not upgrade their components to totally v 4.0

Personally, I wouldn't worry about them unless they are root cause of a major bug (which is unlikely).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文