Reputation: 2184
I'm trying to use a couple of bitmap resources within .netcore2.1
app but when I add an image resource to my project it shows the following error:
Severity Code Description Project File Line Suppression State Error Resource 'sign_here_tag' could not be instantiated. Type System.Drawing.Bitmap, System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 cannot be located.
I have system.drawing.common
NuGet package installed within my project, but the error's still coming up.
after installing CoreCompat.System.Drawing i still have this error coming up:
Even if i change the file extension to wav(to force it to add it as a MemoryStream) i still get the error:
Upvotes: 5
Views: 6339
Reputation: 1
To use namespace System.Drawing
in ASP.NET Core, I suggest you to install this package:
Install-Package CoreCompat.System.Drawing -Version 1.0.0-beta006
(Of course, removing all reference(s) that you've tried before installing this package)
After installing, you can use System.Drawing.Bitmap
and System.Drawing.Image
as normally.
NOTE: If you want to use this package in class library, make sure the library is using .NET Standard
Upvotes: 4