Hello I have a Project Solution consisting of several smaller projects. Those projects have dependencies to some others in the following way:
(1) Native unmanaged C++ dll with device control functions
Is used by…
(2) C# Project wrapping native functions to .Net
Is used by…
(3) Adapter wrapping to the special device to a more generally abstraction layer defined by a framework
Is used by…
(4) A simple example implementation tries to use this native device interface through the abstraction framework
Now the Problem: The native dll (1) is added to the .Net wrapper project (2) as "existing item" with "build event = content" and "copy to output… = always" as "Hans Passant" set it in this problem solution. The native dll is used in this wrapper via DllImportAttribute. And this works fine for this project. The dll will be copied to the output directory and can be found by the wrapper.
The wrapper (2) is used as "Reference" from the adapter-wrapper project (3) and also there the native dll (1) is copied to the output directory and can be found and used by the .Net wrapper (2). BUT…
.. when I than add the adapter-wrapper project (3) to the simple example project (4) as an "Reference" the native dll (1) will not be copied to the output directory of this example project (4). So the dlls will not be found by the .Net wrapper (2) and cause a System.DllNotFoundException.
My question is: How can I make this work, that when I add the adapter-wrapper project (3) to another project, all dlls that are necessary and are in the output-directory (including the native dll (1)), are copied to the referencing projects output directory? And this without adding the native dll as resource to the example implementation as Marc Gravell saying.
Thanks a lot, J