announcements icon indicating copy to clipboard operation
announcements copied to clipboard

Static Web Assets Compression Flag Breaking Change

Open MackinnonBuck opened this issue 2 years ago • 0 comments

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.

MackinnonBuck avatar Nov 07 '23 19:11 MackinnonBuck