c# - MSB3258:mscorlib 4.0.0.0 和 2.0.0.0
问题描述
所以我试图在 VS 2017 上编译一个项目,我得到了这个:
warning MSB3258: The primary reference "someLib.dll" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework.
之后,我遇到与此 dll 相关的错误(例如,类型或名称空间不在名称空间中),但是当我双击该错误时,它会消失,以及代码中的红色波浪线,暗示事实是这不是实际问题。
我尝试过的一切都不起作用:所有项目都在 3.5 上,我删除并重新添加了所有引用,除了我自己的计算机之外,它不会发生在任何其他计算机上。我还尝试从 GAC 中删除 mscorlib(尽管这可能很愚蠢),但它当然不会让我这样做。
我看到了一些可能相关的东西: https ://developercommunity.visualstudio.com/content/problem/230636/assemblydependency-now-misidentifying-indirect-dep.html
除了删除和重新安装 VS,不知道该怎么做。如果有人有任何想法,我很乐意尝试。
解决方案
这是对一个名为“Shell32.dll”的 Interop.Shell32.dll 版本的奇怪引用。不知道从哪里来的。
如果其他人有这个问题:一次删除每个依赖项并编译。甚至微软的。
推荐阅读
- deep-linking - Google Home App中帐户链接的最佳用户体验是什么
- coq - Coq 证明 p
=q
- postgresql - 我可以从 Cloud Run 连接到 Compute Engine 中托管的 Postgres 实例吗?(不是云 SQL)
- java - 在java中创建二维字符数组
- javascript - 相邻兄弟选择器 element.querySelector("+element") 无效
- python - 查找分组列的唯一值?
- excel - 需要帮助简化或改进 excel 中的加权分布公式(数学/excel/编程菜鸟)
- c# - 在 C# Winform 中通过动作创建后调用对象
- html - 如何使文本在按钮中间居中?
- reactjs - React-Redux 中的减速器