Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用.NET Core 3.1中的System.Drawing.Bitmap_C#_.net Core_System.drawing - Fatal编程技术网

C# 使用.NET Core 3.1中的System.Drawing.Bitmap

C# 使用.NET Core 3.1中的System.Drawing.Bitmap,c#,.net-core,system.drawing,C#,.net Core,System.drawing,我正在尝试使用.NETCore3.1库中的System.Drawing.Bitmap 根据文档,该类型在版本3中可用 当我尝试使用Bitmap构建库时,出现错误: error CS1069: The type name 'Bitmap' could not be found in the namespace 'System.Drawing'. This type has been forwarded to assembly 'System.Drawing.Common, Version=4.0.

我正在尝试使用.NETCore3.1库中的
System.Drawing.Bitmap

根据文档,该类型在版本3中可用

当我尝试使用
Bitmap
构建库时,出现错误:

error CS1069: The type name 'Bitmap' could not be found in the namespace 'System.Drawing'.
This type has been forwarded to assembly 'System.Drawing.Common, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
Consider adding a reference to that assembly
如何使用该类型创建.NET Core 3类库


OBS:从.NET核心WinForms中使用该类型不会有任何问题。(并且不需要引用nuget System.Drawing.Common,因为该类型已经存在于SDK中)。

当尝试在.NET Core中处理图像时,我建议使用,这是nuget上提供的一个非常易于使用的跨平台图像库。我很快就知道了它是如何工作的,而且它的文档记录非常好。

所以唯一的方法就是引用NuGet@AlexeiLevenkov@Lex这不是同一个问题,因为我使用的是.NET Core 3.1,根据文档,System.Drawing.Bitmap在.NET Core 3.1上可用,我尝试使用`。但是没有起作用。只有当您必须使用.NET Core<3.11)了解Microsoft文档的真正含义时,才能使用NuGet。2)您尝试的完全错误,因为您需要的是软件包参考,而不是普通参考。谢谢VollRahm:-)。但是,我们的想法是通过使用SDK中的一些东西来减少依赖性。