Skip to content

Instantly share code, notes, and snippets.

@AlexVallat
Created September 7, 2021 09:38
Show Gist options
  • Save AlexVallat/b78423954405ce461ed2717dce97c9c5 to your computer and use it in GitHub Desktop.
Save AlexVallat/b78423954405ce461ed2717dce97c9c5 to your computer and use it in GitHub Desktop.
Publish only the appsettings.environment.json for the publish profile
<ItemGroup Condition="'$(WebPublishProfileFile)' != ''">
<!-- When publishing, publish only the app settings that match the profile being published -->
<Content Update="appsettings.*.json" CopyToPublishDirectory="Never" />
<Content Update="appsettings.$([System.IO.Path]::GetFileNameWithoutExtension('$(WebPublishProfileFile)')).json" CopyToPublishDirectory="Always" />
</ItemGroup>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment