s4eed
s4eed

Reputation: 7891

How to force visual studio to copy some files during build time

I'm building an application which is written with Qt in Visual Studio 2008. Everything is OK and I can run the output, but the executable file depends on some other files to be loaded at run-time. These files need to be copied along with the .EXE file every time they are changed, as I need to run the released output outside the IDE.

Is it possible to copy some files/folder in the output directory right besides the .EXE file during project build-time?

Upvotes: 3

Views: 2643

Answers (2)

T. Muir
T. Muir

Reputation: 21

If using Visual Studio right mouse click the file you want copied to the output folder, select Properties. In the Advanced section, the second option is: Copy to Output Directory. By default this is "Do not copy". Select the other options as desired such as "Copy always" or 'Copy if newer". These properties will be saved to your .csproj file.

Upvotes: 1

Gregor Primar
Gregor Primar

Reputation: 6805

Here is how it's done:

  1. Go to your solution explorer and open project properties
  2. Select "Build events" tab
  3. Enter post build command. You can also use Macros (not sure for VS2008. VS2010 already supports them)

Here is good resource for build events from where you can continue further:

http://msdn.microsoft.com/en-us/library/42x5kfw4(v=vs.80).aspx

Upvotes: 2

Related Questions