0

My project was building without issues in .net framework 4.8.1

I tried to switch the framework to .net 4.0

It gave me some errors, so I switched back, now I get the following error:

Error CS0012 The type 'Bitmap' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Drawing.Common, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

I am looking up how to fix it, but I cannot find any answers

I tried adding System.Drawing.Common as a reference, but it is not visible under any of the references.

What does this error mean, and how do I fix these errors?

enter image description here

LarsTech
  • 80,625
  • 14
  • 153
  • 225
Mich
  • 3,188
  • 4
  • 37
  • 85
  • Are you sure the framework version of your project is actually 4.8 and not higher, or .Net Core or Mono? – Charlieface May 11 '23 at 20:44
  • _Something_ is asking for the .NET 7 version of System.Drawing.Common. Read [ask] and provide a [mre]. – CodeCaster May 11 '23 at 20:55
  • Does this answer your question? [.NET Core and System.Drawing](https://stackoverflow.com/questions/40892189/net-core-and-system-drawing) – Charlieface May 12 '23 at 09:24
  • Hello, here are three methods I suggest you try one by one. 1. Install System.Drawing.Common using the command line. 2. Feel free to find a nuget package to downgrade, and then upgrade 3. Uninstall the solution, and then load it again. See if it works. – wenbingeng-MSFT May 12 '23 at 10:01

0 Answers0