Which is the correct location for external unmanaged DLLs when using [DllImport()] in C#?

  • Thread starter Thread starter Paolo Magalini
  • Start date Start date
P

Paolo Magalini

Guest
Hi, during developments of .NET projects the folders \bin and \degub are created. From the Solution Explorer of Visual Studio, if i chose a project and right-click->Add->Existing Item and chose a DLL, then VS will copy it in the main folder of the project. When i run the project or a debug session, if i use the [DllImport("file.dll")] attribute, the code will throws an exception because is looking the file inside \bin or \debug.

Since actually i manually copy the DLLs, i ask if the the must always be copied in both \debug and \bin or if there is a more elegant way to handle this problem, maybe from some VS settings, or using another approach.

Thank you.

Paolo

Continue reading...
 
Back
Top