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.
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.
this is very useful !
unity very stupid !
Copying System.Drawing.dll from
C:\Program Files\Unity\Hub\Editor\2020.1.6f1\Editor\Data\MonoBleedingEdge\lib\mono\4.5
works for me. Doesn’t give any errors in Unity Editor as well.
Copying System.Drawing.dll from
C:\Program Files\Unity\Hub\Editor\2020.1.6f1\Editor\Data\MonoBleedingEdge\lib\mono\4.5
works for me. Doesn’t give any errors in Unity Editor as well.
thanks it was very helpful.