System.Drawing.Common.dll is not allowed or missing

I’ve tried uninstalling and reinstalling it through the package manager, and adding it directly into Assets/Plugins but i still get the error

ArgumentException: The Assembly System.Drawing.Common is referenced by Emgu.CV.Bitmap (‘Assets/Plugins/Emgu.CV.Bitmap.dll’). But the dll is not allowed to be included or could not be found.

Any advice?

That means that you added “Emgu.CV.Bitmap.dll” to your project and it depends on another DLL (System.Drawing.Common.dll) which cannot be found in your project (perhaps you forgot to add it?).

I added it to Assets/Plugins already, and using the nuget package manager isn’t working either.
Is there another way to have Unity recognize System.Drawing.Common.dll?

Are there any other messages in the editor log regarding it? Can you show its plugin inspector configuration settings?

ok so i checked “Load on startup” and now i’m getting this error.

6845432--797033--upload_2021-2-16_21-44-1.png

I messed around a bit more and am now getting these errors

Where did you get that DLL from? Do you know what .NET version it’s targeting? For Unity you want it to target .NET Standard 2.0.

I’m running Unity 2020.2.2f1 and set my project to work with .NET 4.x (which in my case is .NET 4.7.1).
After manually uninstalling and installing System.Drawing.Common the Nuget folder for that package was stored in my project’s Package folder. I looked inside that folder for System.Drawing.Common.dll and copied it to my Assets/Plugins folder but I’m still getting the errors from the image above

Ok, so i finally got this to build.

So the package i was trying to get to work was Emgu. after cloning the files from Github I had to copy all the .dll folders into Assets/Plugins (i made sure to use the x64 .dlls). the 3 files that was giving me errors was Microsoft.VisualStudio.DebuggerVisualizers.dll & System.Common.dll & System.Common.Drawing.dll

  • how i fixed System.Common.dll
    i created a csc.rsp file in the Assets folder and in that file typed “-r:System.Drawing.dll”

  • how i fixed System.Common.dll

I went into visual studio 2019 and opened the Unity project file.

after enabling my the ability to open the Nuget Package Manager i opened the manager up and looked for System.Drawing.Common.dll

After finding it I selected all the assemblies (Assembly-CSharp, Assembly-CSharp.player,Cinemachine,etc) and hit Uninstall, then after it was finished hit Install.

This created a folder in my Packages folder in my Unity Project.

i went here to grab the right System.Drawing.Common.dll
“\Packages\System.Drawing.Common.5.0.1\lib\netstandard2.0\System.Drawing.Common.dll”

  • how i fixed Microsoft.VisualStudio.DebuggerVisualizers.dll

I went into my “\Program Files (x86)” and in the search box (I’m using windows) i typed
“Microsoft.VisualStudio.DebuggerVisualizers.dll” and it gave me 10+ results. the one i selected was the one located in
“C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies”

i still get some error/warnings about Unity failing to copy some files into the Library folder but it Builds so i’m good for now.

2 Likes