Skip to content

Instantly share code, notes, and snippets.

@SchreinerK
Created August 25, 2024 14:46
Show Gist options
  • Save SchreinerK/5d0b63083edd4cb2c3313f1ac56fcf42 to your computer and use it in GitHub Desktop.
Save SchreinerK/5d0b63083edd4cb2c3313f1ac56fcf42 to your computer and use it in GitHub Desktop.
Copy all 'Page' files with 'CopyToOutputDirectory=Always' setting
<Project Sdk="Microsoft.NET.Sdk">
...
<Target Name="CopyPagesToOutputDirectory" AfterTargets="Build">
<!-- Copy all 'Page' files with 'CopyToOutputDirectory' setting -->
<Copy SourceFiles="@(Page)" DestinationFolder="$(OutputPath)%(RelativeDir)"
Condition="'%(Page.CopyToOutputDirectory)' == 'Always'" />
</Target>
...
</Project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment