- Home /
Where does Unity5 look for native plugin dependencies in the editor on Windows?
I am running Unity5.1.1 on Windows. I have a native dll for a plugin I made, plugin.dll, but it depends on another native cpp dll dependency.dll, so when I try to use plugin.dll in Unity I get "missing dll exception" which is because of the missing dependency. In Unity4, I fixed this problem by placing plugin.dll in the appropriate plugins folder, and dependency.dll in the root folder of the project where the Assets folder is; however this solution does not work for me with the same plugin and dependency in a Unity5 project.
What does work however, is building the game and placing dependency.dll next to the game executable. So I just cannot get the dependency to be found by unity in the editor.
I also tried placing dependency.dll in the plugins folder besides plugin.dll, that also did not work.
I have both 32bit and 64bit versions of plugin.dll and dependency.dll appropriately placed in Assets/plugins/x86 and Assets/plugins/x86_64.
So, does anyone know where does Unity5 looks for native plugin dependencies in the editor on Windows?
Answer by Trigve · Jul 19, 2015 at 01:27 AM
From what I know (and from the testing) it looks like it first try to look in unity.exe origin path, then SysWOW64 (if you're on 64 bit), then System, then Windows, then in the project root dir. So placing the .dll in the project root dir should suffice. If you put the .dll to the unity.exe folder (unity install path), it should work in every case (for testing only). Also be aware, that if the dll with the same name exist in the System dir, it would be loaded first. You could use ProcessMonitor to monitor unity.exe and find which paths it checks when loading your dlls.
I'm currently having trouble with this. I'm running Unity 5.1.2f1, and the editor will crash unless I have my dependencies directly in the folder with the editor exe. It doesn't seem to ever pick up the dependencies if I put them anywhere in the project folder.
Where exactly did you put the .DLL? Because it is working for me.
Your answer
![](https://koobas.hobune.stream/wayback/20220611230034im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Native Plugin Cleanup 0 Answers
Any project explorer addins? 0 Answers
Using Native Plugins in an Android Project and Executing in the Unity Editor 0 Answers