I was trying to be clever, and call UnityEngine.Debug.Log from a .NET Assembly that I’m compiling in Visual Studio. The closest I got, after resolving a few ambiguities, is:
Assembly generation failed -- Referenced assembly 'UnityEngine' does not have a strong name
Is this basically a dead end?
Any recommendations for debugging a .NET Assembly in Unity?
Wow! I was able to sign the UnityEngine.dll, reference it, and call UnityEngine.Debug.Log! How liberating to be able to caveman debug! Now maybe I can fix my bug…
I would like to request that Unity3D ship their dlls with a strong name - unless there’s some undesirable downside…
you can not use Unity DLLs outside of Unity, only the other way round.
What I would recommend you to do is use Unit Tests to test your functionality and once it works, drop it into unity.
as you can move the cs files from unity to your own testing environment, should you need part of it for whatever reason, there should be very little problems.
Unity dll’s don’t work outside of Unity, but what I was trying to do was get my dll to run in Unity and use the UnityEngine assembly. I wanted to write to the Unity Console - this worked beautifully!
–off topic–
In my case, I was trying to get jabber-net (an XMPP dot-net library) to run inside of Unity3D.
The command-line tests with jabber-net worked fine in Visual Studio 2008, but didn’t work in Unity. So, unit tests wouldn’t have helped here.
One big difference is Mono vs. Microsoft.net framework.
By doing what I did to gain access to UnityEngine.Debug.Log I was able to find out what was going wrong. It turns out that it was SslStream and AuthenticateAsClient. I didn’t need an encrypted chat connection for now, so I set jabber-net to use no TLS and use plain text. Worked!
the main difference is likely that Unity is Mono 1.2.5, which is .NET 2.0 with a few things from 3.x but with a few things from 2.x missing as well. I think the SSL part is one of those things (generally the connection / db related part)
Hi Nimai, can u share how you got this working. my debug.log don’t come up