I have a C++ DLL (no code) that I want to expose to .NET applications.
After pondering all the options I have/know of/could find (COM, P/Invoke, SWIG, etc.), I'm writing a .NET Class Library (in C++/CLI). Now the resulting DLL (class library) requires the original DLL and its dependencies, too. My problem lies in automagically keeping track of such things, so that applications that use the wrapper don't have to keep track of the other (native) DLLs (especially if the original DLL(s) develop a new dependancy).
To be more precise (and have something concrete to discuss), I'm trying to wrap cmr
, so I write MR
, the class library (which depends on cmr
, naturally). cmr
depends on PNL
, OpenCV
, and others. When I tried adding a reference to MR
in a (C#) project, Visual Studio (2005 SP1) just copied MR.DLL
, leaving all the dependencies behind, and then complaining (throwing a FileNotFoundException
about missing modules). Manually copying cmr
, PNL
, etc. to the bin
directory fixed the problem.
Without further ado, my question is this: Is there a way for .NET apps to only add a reference to one DLL, and everything just works?
I've been scouring through Google and SO, to no avail...
EDIT: mergebin seems the closest to what I'm looking for, but it can only merge a .NET DLL with one native DLL. Too bad one can't merge native DLLs.