Question

I have a collection of unmanaged dlls with a C# wrapper around them that I'm calling from a C# project. I've added a build event line that looks like:

mkdir ..\Release
mkdir ..\Debug
copy ..\..\Includes\*.dll ..\Release\*.dll
copy ..\..\Includes\*.dll ..\Debug\*.dll

Problem is, when I go to publish the application, those dlls aren't included, and the publication is worse than useless, since it creates an application that runs until you call one of those dlls.

So, how do I include unmanaged dlls when I publish the project?

Was it helpful?

Solution

And the answer is: don't publish this, use the windows installer instead, as described here.

OTHER TIPS

I'm currently investigating the same issue. The literature on the topic is very sparse indeed!

The only solution I can see is to embed the unmanaged DLL as an embedded resource inside the assembly, and programatically extract it out to the executing path before calling any functions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top