Using/Referencing UnityEngine.UI from a Managed DLL

Hi!

I have a problem using managed DLLs: i can link and compile the DLLs fine in MonoDevelop, but using them in a new project i get this error message in the editor console:
(the project is empty save for the dlls)

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

My DLL setup is as follows (not a trivial setup):

HTTP.dll - a custom dll built from a modified UnityHTTP source
Ionic.Zip.dll - a dll used by UnityHTTP, and some of my code
My.dll - “runtime” part of the managed code i wish to use in a dll
Editor/My.dll - “editor” part of the managed code

My.dll references the

  • UnityEngine.dll
  • UnityEngine.UI.dll
  • HTTP.dll
  • Ionic.Zip.dll

Editor/My.dll references

  • UnityEditor.dll
  • UnityEngine.dll
  • HTTP.dll
  • Ionic.Zip.dll
  • My.dll

what am i missing? what could be the problem?

(im on unity 5.2.1p1)

please help, i’m completely stumped as to what could be the cause :frowning:

I am having the same issue

well, i still haven’t found a solution, and since i’ve tried to rebuild the project using mono 3.5 as a target, etc, using debug/release builds etc to no avail.

the project browser shows the dlls and the public classes they expose, but fails to register/use them. :confused:

Same here but only when I import a project containing dll’s e.g. SpriteTile. I’ve googled my google and googled more but I’m googled out. No idea how to fix.

I’m using Unity5.2.1p4

Same issue, it wrecks serialization of scripts that depend on compiled dlls. Fortunately it’s in a testing framework, and can restore the data, but it basically never survives once it hits the git repo or the directories are copied.

Running Unity 5.2.4 at the moment.