System.Drawing namespace not consistently found (Unity version 5.6.2f1)

This is hopefully not the same as anyone else’s problem but, even though both Visual Studio and MonoDevelop apparently have no difficulty accessing the “Sytem.Drawing” namespace once an assembly reference has been created, the Unity Editor throws CS0234 “The type or namespace name ‘Drawing’ does not exist in the namespace `System’. Are you missing ‘System.Drawing’ assembly reference?”, and by extension CS0246 “The type or namespace name ‘Bitmap’ could not be found. Are you missing an assembly reference?”, compile errors. I have tried everything else I could find on the forums. Thank you for your time!

The proper way to include dotNet library not linked in Unity3d:

  1. Create a new text file named mcs.rsp in your Unity project’s root Assets directory.
  2. On the first line in the empty text file, enter: -r:System.Net.Http.dll and then save the file. You can replace “System.Net.Http.dll” with any included assembly that might be missing a reference.
  3. Restart the Unity editor.

You can’t add assembly references inside Visual Studio or MonoDevelop. Usually when you develop a .NET or Mono application you need the .NET framework or Mono installed on the PC. That way the application has access to all assemblies that are included in the framework.

Unity however uses Mono as standalone scripting environment. Every assembly that you want to use has to be physically added to your project. So you have to copy the assembly and all it dependencies into your assets folder. Unity automatically adds the references to the C# project. The C# project actually isn’t “used” at all. Unity has it’s own build command. It directly calls the mono compiler when you build the game.