views:

67

answers:

1

Does anyone know if there is a way to change a file type's default "Copy to Output Directory" setting in Visual Studio 2008?

I often add text files to my projects. They could be anything from readme files, or some usage information, or test files actually used by the app at runtime.

But I've never ever added a text file where I did not want it copied to the output directory on build.

I always want them copied, but I often forget to change the setting (esp if I am adding a bunch, as in the case of the test files). I'd like to set the default for Visual Studio so that ALL .txt files are ALWAYS copied to the output folder.

Does anyone know if there is a way to permanently change the default setting for .txt files so they are always copied?

A: 

You can achieve what you want by adding a postbuild event to your project containing the command

xcopy /d /y $(ProjectDir)*.txt $(TargetDir)
Doc Brown
There must be a way to actually do this correctly. What if I wanted to add a new file type called .clever that worked just like .ASPX files? How would I set the default in that scenario?
Clever Human
I don't how do .ASPX files behave, can you please give me some clue?
Doc Brown