- Home /
Can't get this .NET DLL working in Unity. Why not?
Here's a download: https://dl.dropboxusercontent.com/u/11217331/VSDK.zip
The .NET dll of this SDK is a wrapper for the unmanaged code in the CPP dll. For some reason, Unity doesn't import the .NET dll whatever I try.
I tried making a Mono DLL of my own that imports the SDK .NET dll, in an effort to forward the functionality, but I just get a TypeLoadException in the class where the SDK is referenced (since, I guess, the SDK dll still has to be loaded by Unity).
I don't know what's causing this. The SDK .NET dll is build with .NET 2.0, and doesn't seem to have any incompatibilities with Unity's version of Mono. I'd love to hear why it's not working.
Answer by TristanChambers · Aug 04, 2016 at 05:05 AM
Is it possible you just need to run unity or the build as an administrator? I have an issue right now where a dll does not load unless I right click then "Run as Administrator". Even though the user is obviously an administrator.
Unity loads this dll fine on all of my other computers except my windows 8 computer. Perhaps there is something special with windows 8?
P.S. I realize this is an old question, but this showed up in google when I was searching for a solution to my problem and it appears some people are still having this issue.
Answer by Bilelmnasser · Jun 06, 2014 at 11:00 PM
i downloaded your Dll and your Plugin Work Fine, and your unity too, make sure you put your DLL under The Folder Plugins under the Main Assets Folder (create a new folder if there is none and put all DLL there that unity can access them):) and see this tutorial DLL c/c++ Tutorial plugin in unity (free/pro/any license)
Is it possible you can give me your entire Unity test project in which you got this dll to load? I've tried what you said many times before, but it doesn't load the SD$$anonymous$$ dll, or it displays errors when loading my own $$anonymous$$ono dll that imports the SD$$anonymous$$ dll.
http://goo.gl/v2k$$anonymous$$eO the test scene is just printing a dll member , i don't really know how to use your dll and what for it's just test of using your dll and accessing it :)
and it's a package, create a new project and import the package i uploaded good luck :)
So that works for you? I've tried this approach a lot. I get "Assets/Scripts/test.cs(3,7): error CS0246: The type or namespace name `ViconDataStreamSD$$anonymous$$' could not be found. Are you missing a using directive or an assembly reference?". $$anonymous$$eaning it still doesn't load for me. But at least SO$$anonymous$$EONE got it working! Can I ask you what OS and Unity version you're using? Anything special in how you set Unity up (compiler changes 'n stuff)?
yeah i see your problem now, here is a tutorial how to fix unmanaged code in the CPP dll into unity (pro /non pro/free license /any unity )
$$anonymous$$y Tutorial Link about c++ Dll import into any licensed unity (free/pro/non pro)
the technic is simple, create a C# Dll that allow you to use c++ Dll and that's it as simple as that :)
Your answer
Follow this Question
Related Questions
How do I use .NET 4.5 managed DLL called by a native DLL (Not easy, I swear I read doc) 0 Answers
Can I use .NET 4.5 assembly as external library? 1 Answer
Trying to use SDK as plugin that compiled with .NET Framework 4.0 in Unity 1 Answer
Getting SSH.NET to work in Unity 1 Answer
Scripting Generic stat modifiers. 0 Answers