3

I have a C# solution in Visual Studio 2008. I have added a configuration file (called configuration.xml) to the "Solution Items" of the solution.

The idea is to have this file copied to each Project's debug/release directory upon build. How can I achieve this?

lejon
  • 1,107
  • 1
  • 9
  • 7

2 Answers2

4

In the post build step for each of your projects add the following line

copy /Y $(SolutionDir)/configuration.xml $(ProjectDir)

If your configuration file is in a solution subdirectory you have to add that to the source path of course.

TToni
  • 9,145
  • 1
  • 28
  • 42
2

You could also add the file as a link to each project (see this answer.) This is often easier to see than looking at the project properties for a post-build step.

Community
  • 1
  • 1
Pedro
  • 12,032
  • 4
  • 32
  • 45