I have a C# project say MyProject.csproj located at \"C:\\Projects\\MyProject\\\". I also have files that I want copied into the output directory of this project. But, the f
The answer of Mandark adds the content files directly to the solution, and they will show up in the solution explorer. Whenever a file is added or deleted in the original directory, this is not picked up by visual studio automatically. Also, whenever a file is deleted or added in the solution explorer, the project file is altered, and all files are included separately, instead of just including the folder.
To prevent this, you can use the same trick, but put it in a separate project file and then import it.
The project file (for example include.proj) looks like this:
%(RecursiveDir)%(Filename)%(Extension)
PreserveNewest
In your own project file, add the following line
Visual Studio will not mess with this file, and just adds files as content during a build. Changes in the original directory are always included. The files won't show up in your solution explorer, but will be included in the output directory.
Picked up on this trick here: http://blogs.msdn.com/b/shawnhar/archive/2007/06/06/wildcard-content-using-msbuild.aspx