- Home /
DLL placement
Hello,
I would like to know: If I am going to use a DLL in my project, where should it be placed. I have read that it depends on the type of DLL (if it has been written in C# or C++). I have seen Unity projects where the DLL has been placed in the root folder, other instead are inside the /Assets folder, and some others inside /Plugins folder.
Thanks in advance.
With my experience in managing and unmanaged there is no dependency on where it's put, this is in unity 5.5.
I am currently using Unity 5.5.0f3 with a C++ native plugin. If I put this .DLL inside the /Assets folder or inside any other below it, the console in Unity Editor shows the "DLLNotFoundException", but if I place it in the root folder of the Unity project, it works perfectly.
When I compile the project, I have to copy&paste that .DLL and put it next to the .exe, otherwise it doesn't work.
Am I doing anything wrong or it seems a special case? Thanks :)
Answer by tanoshimi · Jan 19, 2017 at 09:16 PM
They can be placed anywhere.
In previous versions of Unity, the location of the plugin determined the OS for which it was targetted (i.e. Assets/Plugins/iOS or Assets/../Plugins/x86), but this is no longer the case. However, you may still find it useful to keep your DLLs organised like this since Unity will use it to infer default settings from the plugin location, as described at https://docs.unity3d.com/Manual/PluginInspector.html
Ahh and here I was thinking that it HAD to be placed in a folder named "plugins"! Thanks for clearng out the confusion. I've actually been googling for this info before but haven't found the right source of info before. Are there other updates to folder requirements that one should know about for other types of asset perchance?
There are a few other "special" folders: - /Editor - /Gizmos - /Resources - /Strea$$anonymous$$gAssets
None of these have had recent updates in usage AFAI$$anonymous$$
Your answer
Follow this Question
Related Questions
Import C# project into my Unity solution 1 Answer
Problem with dll plugin 0 Answers
UnauthorizedAccessException when accessing DLL 1 Answer
Native c++ plugin on android 0 Answers
How to link to scripts in the Package Manager when building a dll. 0 Answers