I have a Visual Studio solution with two projects :
-
A class library
MyLibMyLibreferencesMyAssembly.dllMyAssembly.dllis dependent onmynativedll.dllwhich is not a .Net assembly, but a native dll.
-
A web project
MyWebMyWebreferenceMyAssembly.dll
In the web project, where should I put the mynativedll.dll ?
If I put this dll in the bin directory, the dll is voided when cleaning.
If I put this dll, beside MyAssembly.dll in “Lib” folder and I add a probing path to this folder, this does not works. Actually, the MyAssembly.dll is copied to the bin directory (as it’s a reference), even if I set “Copy to local” to true.
What are the correct way to handle such cases ?
Oh … simply in fact.
I directly referenced the
MyAssembly.dllin the web project (even I not required from a code perspective).Then I set up “Copy local” to false in the web directory.
and that solved the problem.
The
MyAssembly.dllis not copied to the bin folder, but red from the lib folder where the native dll also resides in.