我有一个从“类库”类型的项目编译的DLL,该项目具有netcoreapp3.1的目标框架(编辑:现在是netstandard2.0)。
然后,我在另一个项目( Windows应用程序)中引用这个DLL,该应用程序的目标是.NET框架4.7.2 (编辑:现在是4.8)。
在试图编译Windows窗体应用程序时,我得到以下错误:
Error CS1705: Assembly 'BC' with identity 'BC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'我想在System.Runtime项目上更新WinForms以使用版本4.2.2.0 (这显然是我的DLL所必需的),但是,我没有找到这样做的方法-没有安装NuGet包,Visual中的参考部分似乎没有直接包含System.Runtime:

如何更新System.Runtime并解决错误?
发布于 2021-06-21 11:08:01
尝试以下任何一种方法:
为了获得最好的兼容性,尝试两者兼而有之:将库设置为.netstandard2.0,并将WinForms应用程序更改为.NET 4.8。
https://stackoverflow.com/questions/68066267
复制相似问题