Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Visual Studio 2010 automatically copy a compiled file to another directory?

I have two projects, one VB6 project which compiles to an EXE and one MSVC++2010 project which compiles to a DLL. The DLL needs to be in the same folder as the EXE file in order to work. Can I have Visual Studio 2010 automatically copy the compiled DLL to the VB6 project folder after a compilation?

like image 409
Felix Dombek Avatar asked Apr 20 '11 16:04

Felix Dombek


2 Answers

The easiest way to set this up is to use a post build event. These run once a build is successfully completed and has a set of handy macros to make access to common outputs, like compiled files, very easy

For example. Here are the steps to a compiled DLL / EXE into c:\temp

  • Right Click on the Project and select "Properties"
  • Click on the Build Events Tab
  • Add the following line to the "Post-Build" box: copy "$(TargetPath)" c:\temp

In the above $(TargetPath) is a macro for the primary output of a build task: typically the EXE or DLL file. If you click on the "Edit Post Build" button, then macros you can see the full list of supported macros.

like image 150
JaredPar Avatar answered Oct 20 '22 12:10

JaredPar


I believe you're asking for Post Build Events

An example of what you want to do, I believe, can be found here

like image 22
Smudge202 Avatar answered Oct 20 '22 14:10

Smudge202