I'm trying to run a simple C# Application on windows 11. I'm using the System.Drawing to edit a png file, but this error is occuring.
System.PlatformNotSupportedException: 'System.Drawing.Common is not supported on this platform.'
After a bit of research, turns out System.Drawing is only supported on windows.. but I am using windows.. Perhaps it's because I'm using windows 11?
Furthermore, adding
AppContext.SetSwitch("System.Drawing.EnableUnixSupport", true); Didn't seem to fix this issue either
The error is thrown on this line of code:
Bitmap bmp = new Bitmap(Bitmap.FromFile(file));