In Visual Studio, how can I set the Build Action for an entire folder?

Create the project. Add one file as Content. Unload the project and edit the *proj file manually.

 <ItemGroup>
    <Content Include="myfolder**\*.dll**">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

And then in the content-ItemGroup I would replace that singe file with some MsBuild wildcard expression, *.dll, or whatever.

Leave a Comment