27

Subj.

"Automatically" is essential here. References from GAC must not be copied.

I've seen e.g. VS2008.NET: Getting a referenced project’s dependencies to copy to main project’s bin folder, and this isn't interesting for me. I'd like all the dependencies get copied automatically.

Community
  • 1
  • 1
Alex Yakunin
  • 6,330
  • 3
  • 33
  • 52
  • 3
    Fortunately, I answered this question by my own. If you're interested, [the solution is here](https://web.archive.org/web/20180805184435/http://blog.alexyakunin.com:80/2009/09/making-msbuild-visual-studio-to.html). – Alex Yakunin Sep 16 '09 at 07:38
  • 10
    It'll be useful if in addition to your blog, you'll post it here as an answer and accept it as well. – Noctis Jun 17 '14 at 02:07

2 Answers2

1

For C++ projects, i.e. *.vcxproj set the <OutDir> property.

for C# projects, i.e. *.csproj set the <OutputPath> property.

Make sure nothing overwrites those properties. In all my years doing builds for major, large products, I've never had to do anything different. If you have to do any other clever hack, you are surely doing something wrong.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
C.J.
  • 15,637
  • 9
  • 61
  • 77
-1

use post build event
EDIT

XCOPY c:/additionlib $(OutDir)
Arsen Mkrtchyan
  • 49,896
  • 32
  • 148
  • 184
  • 1
    There are a lot of perf issues with such a Postbuild event there are better option that use a custom target that specifies an inputs attribute to prevent msbuild from copying files over and over again. – jessehouwing May 09 '18 at 16:22
  • Right. Do not ever use post build events. In the last 10 years, I have always deleted post build events when-ever I have found them, and replaced them with real msbuild targets. – C.J. May 29 '18 at 15:43