2

I have a Visual Studio (2015) project, written in C#, that is dependent upon an external dll (say a.dll), written in C++. This in turn is dependent upon other libraries (say b.dll, c.dll), also written in C++. These in turn are dependent upon some boost libraries. I have no control over any of the libraries, but they must be used to complete the project.

Adding library a.dll to the visual studio project is fine. I can add it as a reference and that works. However, it does not run, because the other libraries are not present.

When I try to add b.dll and c.dll to my project, then I get an error:

A reference to 'a.dll' could not be added. Please make sure the file is accessible, and that it is a valid assembly or COM component.

Using this answer (https://stackoverflow.com/a/12639732/5503148) I tried running TlbImp, and got this error:

TlbImp : error TI1002 : The input file 'b.dll' is not a valid type library.

If I copy the libraries to the output folder manually, or get them copied automatically by adding them to the project (not as references), then it all runs.

However, in the end result the project needs to have a dependency on the libraries. That way they can be loaded into another third party product.

Is there a way to do this manually - i.e. tell Visual Studio that the library a.dll is dependent upon other libraries?

Community
  • 1
  • 1
David Setty
  • 609
  • 1
  • 6
  • 16
  • 1
    I think you need a deploy step. For example "after build event" running the script, which copy all need files to output folder. – Dmitry Razumikhin Feb 28 '16 at 16:55
  • 1
    I can get the files copied to the output folder - I can add them to the project and set "Copy if newer" or "Copy always" on the properties. However, in order to install the project on a 3rd party app, the project itself needs a reference to them. – David Setty Feb 28 '16 at 17:20
  • So, just make a readme about how to deploy you library and a dependencies. SQLite do it, for example, (https://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki): "The binary packages are intended to be used by developers in order to obtain the assembly binaries necessary for development and deployment of their applications onto customer machines via XCOPY deployment." https://en.wikipedia.org/wiki/XCOPY_deployment – Dmitry Razumikhin Feb 28 '16 at 20:19

0 Answers0