There is Copy to Output Directory property for files in C# projects. But in VC++ projects it is absent. I know, that I can use Build events in VC++ and wri
Following henri-socha's answer about VS2015 (and probably VS2013 and VS2012, or anything using MSBuild style projects), the ItemGroup item type is important.
Specifically
items do not seem to be copied, whereas
items do.
So, for a project directory Data containing a text file ThisIsData.txt, this will create a subdirectory Data under the $(OutDir)
directory and copy the file ThisIsData.txt from the project into it if it's newer:
PreserveNewest
This won't, although it is what the Visual Studio IDE will insert if you add the text file to your project, and set the Content
property to True
.
true
So in other words you need to add the file via the IDE to make it realise the file is included in the project (which adds
tag ItemGroup), and then open the project in a text editor and add the
tag ItemGroup to get it to do what you want.
I'm not sure what the
tag actually does. It may be a remnant since the only MSDN reference I could find considers it archived: https://msdn.microsoft.com/en-us/library/aa712517.aspx