DLL found in editor but not in build version
Hello,
I've built some dlls in C++, x86 and x64, add them to my Unity (5.3.2f1) project in the respective folders (/Plugins/x86 and /Plugins/x64) and it works great on play mode.
However, when I build the project for deployment, it doesn't find the dlls. It is looking for the path "Build_x[86/64]/Test01_Data/Plugins/myDll.dll", which is there, but it just can't find it! I've checked and the copied dlls are the correct ones (x64 for the x64 build and the same for x86) and if I move all the dlls to the same folder as the executable, it runs.
I know this question is very simmilar to this one but I could'nt figure out the solution. Any ideas why he doesn't find dlls on the Plugin folder?
Thanks in advance,
Mário Pinto
$$anonymous$$an, I'm having the same problem.
I must find a solution because is from a project from a client. If I find something I will share with you.
Answer by Barruchi · Feb 04, 2017 at 05:22 AM
Found a solution Here... In my case the class that import the .dll was using the DllImport in a wrong way. When using the DllImport you should not add the extesion (.dll)
Wrong: [DllImport("MediaInfo.dll")]
Right: [DllImport("MediaInfo")]
$$anonymous$$aybe when using the wrong way Unity_Editor search the .dll in the project Root folder and Unity\Editor folder.
Answer by Pawciu · Mar 19, 2021 at 11:28 PM
I had similar problem but this might work for methods but can't add [DllImport] for classes and structs when using managed dll.
I had to pass additional parameter to compiler which i described here: https://forum.unity.com/threads/error-cs0246-when-building-on-ci-azure-devops-build-agent-with-plugin-dlls.1077869/