Why am I getting the following error when compiling this assembly?

The namespace UnityEngine.EventSystems actually appears in UnityEngine.UI.dll and not UnityEngine.dll so it seems you need to reference the former too when compiling manually from the command-line. Unity projects have this by default (see below).

This is verified by opening up the assembly in your reflector tool of choice, here I am using JetBrains dotPeek:

enter image description here

This is how my test project appears with default Unity references. Note that by default a reference to UnityEngine.UI already appears in the Unity-created project:

enter image description here

When I built my Windnows desktop app via Unity, the above dlls appeared in:

<drive>:<projectOutFolder>\<projectName>_Data\Managed


I checked the UnityEngine.dll and the Eventsystems/UI namespace is not included. Despite, there is a dll in Unity5\Editor\Data\UnityExtensions\Unity\GUISystem\UnityEngine.UI.dll which includes these namespaces.


You can try:

right click on "project panel", and after "Reimport All".

It's can be happen due to switch between platforms, e.g. IOS, or Desktop.. thus, folrders are deleted by became unecessary..

Solve for me: Unity 5.2, Win 7, 32bits;

Good luck!