3

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.

Dukhabandhu Sahoo
  • 1,394
  • 1
  • 22
  • 44

1 Answers1

0

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

  <ItemGroup>
    <None Update="YourFolder\**">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
NewTom
  • 109
  • 2
  • 9