-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
When a project referencing the Razor SDK (directly or through web/* SDKs), and contains a Properties\launchSettings.json file, it will be copied to the build output but not the publish output.
The SDK explicitly forbids copying assets in $(AppDesignerFolder) to the publish directory.
In the 3.0 wave, the behaviour of dotnet build was changed to be more like dotnet publish. The web SDKs should follow the same philosophy and not copy development assets needlessly to avoid users copying them to production (which could contain env vars with connection strings or similar).
To Reproduce
Steps to reproduce the behavior:
- Use .NET Core SDK 3.0.100
dotnet new razordotnet build -c Release- See that the output contains
bin\Release\netcoreapp3.0\Properties\launchSettings.json
Expected behavior
Assets in Properties folder not copied to the build output (Behaviour before 3.0.* SDKs).
Additional context
The Razor SDK contains
<!-- Set CopyToPublishDirectory to Never for items under AppDesignerFolder ("Properties", by default) to avoid publishing launchSettings.json -->
<Content Update="$(AppDesignerFolder)\**" CopyToPublishDirectory="Never" Condition="'$(AppDesignerFolder)' != ''"/>in Sdk.Razor.StaticAssets.ProjectSystem.props but I cannot find this file on GitHub..
Adding CopyToOutputDirectory="Never" would address this issue.