在类库(.NET标准)中找不到位图类 [英] Cannot find Bitmap Class in Class Library (.NET Standard)

查看:150
本文介绍了在类库(.NET标准)中找不到位图类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个类库(.NET标准),并且正在使用System.Drawing, 但出现错误:

I want to make a Class Library (.NET Standard) and I'm using System.Drawing, but I get the error:

CS0246 C# The type or namespace name 'Bitmap' could not be found 
(are you missing a using directive or an assembly reference?)

我正在使用.NET Standard 2.0.

I'm using .NET Standard 2.0.

推荐答案

更新

截至上个月(2018年5月),Microsoft的生产版本(以前是预览/RC)为System.Drawing.Common,这是一个NuGet软件包,它将取代CoreCompat.System.Drawing软件包的两个版本.以后应该使用它.

As of last month (May 2018), Microsoft have a production release (previously it was preview/RC) of System.Drawing.Common, a NuGet package which supersedes both versions of the CoreCompat.System.Drawing package. This should be used going forwards.

现在,您可以使用 CoreCompat.System.Drawing nuget包

For now you can use the CoreCompat.System.Drawing nuget package.

我们已经在生产代码中使用了几个月(使用视频屏幕截图),并且运行良好.基本上,它是System.Drawing的插槽替代.

We've been using it in production code for a few months (drawing on video screencaps) and it has been working great. It's basically a slot-in replacement for System.Drawing.

这篇关于在类库(.NET标准)中找不到位图类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆