dotnet / announcements

Subscribe to this repo to be notified of Announcements and changes in .NET Core.
Creative Commons Attribution 4.0 International
1.27k stars 44 forks source link

Static Web Assets Compression Flag Breaking Change #283

Open MackinnonBuck opened 9 months ago

MackinnonBuck commented 9 months ago

This issue is a locked mirror of https://github.com/dotnet/aspnetcore/issues/51922. See that issue for discussion.

Static Web Assets Compression Flag Breaking change

The <BlazorEnableCompression> flag was renamed to <CompressionEnabled> starting in the .NET 8 Preview 4 SDK.

Static web asset compression is still enabled by default when using the StaticWebAssets SDK. It can be disabled in the app's project file or from the .NET CLI:

MSBuild

<PropertyGroup>
  <CompressionEnabled>false</CompressionEnabled>
</PropertyGroup>

.NET CLI

dotnet publish -p:CompressionEnabled=false

Note that this change is associated with the version of the .NET SDK used to build the project and is independent of the project's TFM. For example, a project with a TargetFramework of net7.0 will need to react to this breaking change if it gets built with the .NET 8 SDK.

Context

The Static Web Assets feature was moved from the Blazor WebAssembly SDK into its own SDK in .NET 8. As part of this work, MSBuild properties with the name Blazor in them were renamed to indicate that they are not limited to Blazor scenarios.