How to pull output (.dll) from one project to anot

2019-08-27 02:49发布

As the part of a bigger solution, I have two projects.

One is c++ library packed as a DLL, and other is .NET wrapper for it.

What would be the best way to indicate to Visual Studio that output DLL from first project is to be pulled into the destination folder of second project, and more: for projects that use wrapper, will they pick up also the DLL from the first one.

I could do it with post-build steps, but I'm after something more sophisticated. Is that possible?

EDIT: we could also ask: "How to add unmanaged reference?"

solution image

1条回答
别忘想泡老子
2楼-- · 2019-08-27 03:20

I guess I found a solution, that might be satisfying...

Steps:

  • in wrapper project, I'll add a DLL that is now present in the output directory of the LIBRARY. Any configuration will do.
  • Pre-build step for the wrapper project should COPY output of the library that is currently configured to be built into the source directory directly
  • option for the file will be 'do not build' and 'copy to output directory if newer'
  • in version control, that file will be IGNORED by version control (I use svn, hope it's possible in others as well).
查看更多
登录 后发表回答