[英].NET Standard 2.0 library referenced by .NET 4.6.1 project - Wrong version of Drawing library referenced
I am trying to get a .NET standard 2.0 library (that uses System.Drawing) to be referenced by a .NET 4.6.1 project (that implements a function that passes the ImageFormat enum). 我试图获得一个.NET标准2.0库(使用System.Drawing),以供.NET 4.6.1项目(该实现实现传递ImageFormat枚举的函数)引用。
I get the following error in the implementing project. 在实施项目中出现以下错误。
The type 'ImageFormat' is defined in an assembly that is not referenced.
类型“ ImageFormat”在未引用的程序集中定义。 You must add a reference to assembly 'System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
您必须添加对程序集'System.Drawing.Common,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = cc7b13ffcd2ddd51'的引用。
The .NET standard 2.0 library includes the nuget package System.Drawing.Common 4.5.0 (which includes ImageFormat). .NET标准2.0库包括nuget包System.Drawing.Common 4.5.0(包括ImageFormat)。
The .NET 4.6.1 project references System.Drawing 4.0.0 (which also includes ImageFormat). .NET 4.6.1项目引用System.Drawing 4.0.0(还包括ImageFormat)。
4.5.0 vs 4.0.0 4.5.0和4.0.0
So the message makes sense... I am not referencing the correct version of System.Drawing in the .NET project! 因此,该消息很有意义...我没有在.NET项目中引用System.Drawing的正确版本!
But I can't work out what I need to do to resolve it. 但是我无法解决该问题。
Can anyone please help? 谁能帮忙吗?
I had a similar problem. 我有一个类似的问题。 I couldnt use anything from .netCore and i had a similar error message and what i did was to right click to the solution and to open the nuget manager and to install the .netCore manualy and it worked.
我无法使用.netCore的任何内容,并且收到类似的错误消息,我所做的是右键单击该解决方案并打开nuget管理器并手动安装.netCore,此方法可以正常工作。 Try it and see if it works.
试试看,看看是否可行。 Greetings!
问候!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.