'How to change the properties of all the files of a folder to "Copy Always" automatically?

I want to change the properties of all the files of a folder to "Copy Always". Currently I'm changing the property manually in Visual Studio(2013 Proffessional) like follows:

enter image description here

When a new file is added to that folder then the Copy to Output Directory value is "Do not copy" which is the default. I want it to automatically change to "Copy Always" every time when a new file is added to that folder.

FYI: I am keeping the DB script files within that folder which needs to be available during auto-deployment.

Any help how to achieve this? Many many thanks in advance.



Solution 1:[1]

You can edit your project file (.csproj) like this (using the **):

  <ItemGroup>
    <None Update="YourFolder\**">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Adrian Mole