Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use System.Drawing.Bitmap from .NET Core 3.1 #37866

Closed
viniciusjarina opened this issue May 23, 2020 · 2 comments
Closed

Use System.Drawing.Bitmap from .NET Core 3.1 #37866

viniciusjarina opened this issue May 23, 2020 · 2 comments
Labels
area-System.Drawing question Answer questions and provide assistance, not an issue with source code or documentation.

Comments

@viniciusjarina
Copy link

I am trying to use System.Drawing.Bitmap from a .NET Core 3.1 library.

According to docs https://docs.microsoft.com/en-us/dotnet/api/system.drawing.bitmap?view=dotnet-plat-ext-3.1 the type is available in the version 3.

When I try to build the library using Bitmap I got the error:

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

How can I create a .NET Core 3 class library using that type?

OBS: Using that type from a .NET Core WinForms work without any problem. (and there is no need to reference the nuget System.Drawing.Common since the type is already in the SDK).

@scalablecory scalablecory transferred this issue from dotnet/core Jun 13, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Drawing untriaged New issue has not been triaged by the area owner labels Jun 13, 2020
@ghost
Copy link

ghost commented Jun 13, 2020

Tagging subscribers to this area: @safern, @tannergooding
Notify danmosemsft if you want to be subscribed.

@Symbai
Copy link

Symbai commented Jun 15, 2020

You need to manually install the nuget package https://www.nuget.org/packages/System.Drawing.Common/ this is by design and you also have to do this on a WPF project. I expect that Winforms project automatically contains this reference for some reason. There is also a blog post from Hanselman about this https://www.hanselman.com/blog/HowDoYouUseSystemDrawingInNETCore.aspx

@tannergooding tannergooding added question Answer questions and provide assistance, not an issue with source code or documentation. and removed untriaged New issue has not been triaged by the area owner labels Jul 8, 2020
@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Drawing question Answer questions and provide assistance, not an issue with source code or documentation.
Projects
None yet
Development

No branches or pull requests

4 participants