Why are only certain .NET libraries available in Unity?

When I try to use System.Drawing I get this error:

Assets/Scripts/TileCanvas.cs(3,14): error CS0234: The type or namespace name `Drawing' does not exist in the namespace `System'. Are you missing `System.Drawing' assembly reference?

I am most certainly not missing the System.Drawing assembly reference. Moreover, when I look at the list of all references there’s nothing to distinguish System.Drawing from any of the namespaces that work just fine. So how am I supposed to tell the difference between references that work and references that don’t before I see the error message?

I don’t actually need help getting rid of the error message because I found that answer here: Using drawing package like System.Drawing - Unity Answers . But my question still stands about why Unity works this way.

Also, System.Drawing.Size has a SerializableAttribute. So why can’t I set its properties in the inspector?

Unity doesn’t use the .NET framework but an old version of Mono. The only exception is the WindowPhone build target which actually uses .NET. Of course Unity does not include all the standard libraries since they all would need to be shipped with your game.

Unity is not a .NET or Mono application. Unity is written in C++. It just uses Mono / .NET as scripting environment.

Manually adding references to assemblies in MonoDevelop or VisualStudio is pointless. Unity doesn’t use the “.csproj” file at all. It only creates this file so the code editors get all the information they need. Unity compiles the actual assemblies directly with the shipped Mono compiler.

If you actually need an assembly which is not part of the core, you have to copy it into your assets folder of your project. Keep in mind that you may need to copy also other assemblies where the imported assembly depends on. Also note that some assemblies of the .NET framework can’t be included into Unity as they may depend on OS specific implementations (like Windows Forms).

ps: If you had searched first you should have found tons of similar questions like this, or this, or this