My code works but wherever I have System.Drawing.Image or System.Drawing.Bitmap the Visual Studio underlines it and shows as error:
The type or namespace name 'Image' does not exist in the namespace 'System.Drawing' (are you missing an assembly reference?)
I have System.Drawing.dll in Assets\Plugins, and in VS I did Project>Add Reference>selected that dll (It is in the list of references in VS although with yellow exclamation mark with no additional info). I am using .NET 4.x scripting backend. Windows will be the only target and this dll is essential for the functionality of my app.
I would not care about seeing long error list but I cannot Attach to Unity, so debugging my project is hard. Is there a way to fix this?
Solved… 6 months with this issue and fixed 5 minutes after posting this.
That is the problem if I use that dll from unity…\mono\ directory, as every post around recommends.
Solution is using that dll from C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0 (4.6 also fails)
Unity will complain “Loading assembly failed: Assets/Plugins/x86_64/System.Drawing.dll” but VS does not.
i know its an old thread but i fixed this simply by going to Project Setting → Player scroll down to confuration and changed the Api Compatibility Level to .NET Framework. for some reason it was trying to use .NET Standard 2.1… hope it helps someone out there.