Charles
Charles

Reputation: 483

Copy exe references to output folder

Say I create a visual studio class project A which is a wrapper around an exe. Getting the exe to be copied to the output directory is easy.

Now I create another project B that references the class A. Is there a way to set up project A such that project B will also copy the exe to the output directory when compiling? Like the exe to be a sort of "copy local dependency" of project A.

Thanks

Charles

Upvotes: 3

Views: 3227

Answers (1)

WozzeC
WozzeC

Reputation: 2660

Right, this is one way to do it. Will work if you have them both in the same solution in Visual Studio.

  1. Add the reference Project A to Project B. (Or vice versa if I missunderstood you)
  2. Right click the solution and select properties.
  3. In Common properties you select Project dependencies.
  4. In the project drop down select Project B and check Project A in "Depends on"-Checked listbox. (or vice versa)
  5. Build project.

You should now have Project A.exe in Project B output folder.

To add an existing exe, which isn't inside your solution, you add the exe as a reference to your project.

Upvotes: 7

Related Questions