c# - mscorlib 上的警告 MSB3258 以供共享参考
问题描述
因此,我目前正在开发一个 .NET Framework 项目,该项目引用由我正在使用的另一个开发人员制作的 DLL,我将其称为“random.dll”。我的项目的目标是 .NET 3.5。我的项目中没有编译器错误,但是当我在引用此 DLL 时尝试构建时,我在构建期间收到警告,指出无法解析引用:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3258: The primary reference "random.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.
在尝试引用该引用中的类时,此构建警告会导致我的构建失败。
然后我压缩了我的项目并将其发送给开发人员,他们能够在不更改项目的情况下自行构建它。我试图弄清楚只有在我的机器上可能会导致此问题的不同之处。
解决方案
将您的 .net 框架更改为 4.0.0
推荐阅读
- node.js - 用户发送消息时如何赋予角色
- jquery - jQuery 禁用 css:hover 类
- c++ - 用索引直接访问替换循环(和其中的条件)
- .net - 在没有访问密钥/秘密的情况下提供对 S3 的访问?
- javascript - Firebase 实时数据库:“值”事件是否会自动触发
- laravel-5.8 - 如何在 laravel 会话中获取手机号码
- android - Appium 不适用于 Android 调试版本
- ios - 编码通用 String 对象给出 nil Swift
- java - 如何在 javafx 中制作好看的排行榜?
- java - 周一:周五:无法理解它是如何工作的