Blazor Hybrid Windows publish still copies precompressed .gz and .br assets from referenced RCLs into publish/wwwroot
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 56/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp
- Domain
- build-system
Research direction
Start by tracing GeneratePublishCompressedStaticWebAssets and _PublishStaticWebAssetsPreserveNewest in the publish targets, then compare how the existing ConvertStaticWebAssetsToMauiAssets filtering handles AssetRole="Alternative" assets. Reproduce with a MAUI Blazor Hybrid app that references an RCL and inspect its published wwwroot/_content/<Rcl>/ directory. Done means publishing with CompressionEnabled=false leaves only the uncompressed RCL assets.
Written by the indexing model from the issue text.
Description
Description
Blazor Hybrid sets <CompressionEnabled>false</CompressionEnabled> (via Microsoft.AspNetCore.Components.WebView's StaticWebAssets.Groups.targets) because WebViewManager serves static assets locally without HTTP content-encoding negotiation. However, when a Blazor Hybrid app references a Razor class library (ProjectReference), the RCL still builds with CompressionEnabled=true by default and contributes precompressed .gz and .br (AssetRole="Alternative") static web assets to the consuming app's publish manifest.
While https://github.com/dotnet/maui/pull/33917 (for https://github.com/dotnet/maui/issues/33773) filtered AssetRole='Alternative' .gz/.br items out of @(MauiAsset) in ConvertStaticWebAssetsToMauiAssets (fixing Android APKs), it did not remove them from @(StaticWebAsset) / _PublishStaticWebAssetsPreserveNewest. As a result, publishing a Blazor Hybrid app on Windows (MAUI Windows, WPF, or WinForms) still runs GeneratePublishCompressedStaticWebAssets (Brotli) for the RCL and copies redundant .gz and .br files for every RCL asset into publish/wwwroot/_content/<Rcl>/.
Discovered during validation testing in https://github.com/dotnet/aspnetcore/issues/68814#issuecomment-5536899858.
Steps to Reproduce
- Create a new MAUI Blazor Hybrid app and a Razor Class Library from templates and reference the RCL:
dotnet new maui-blazor -n MauiHybridApp dotnet new razorclasslib -n MyRcl dotnet add MauiHybridApp/MauiHybridApp.csproj reference MyRcl/MyRcl.csproj - Publish the MAUI app for Windows:
dotnet publish MauiHybridApp/MauiHybridApp.csproj -c Release -f net11.0-windows10.0.19041.0 - Inspect
MauiHybridApp/bin/Release/net11.0-windows10.0.19041.0/win-x64/publish/wwwroot/_content/MyRcl/. - Expected: Only uncompressed RCL assets (
exampleJsInterop.js,MyRcl.<hash>.bundle.scp.css,background.png) are published whenCompressionEnabled=false. - Actual: Precompressed
.gzand.brfiles (exampleJsInterop.js.gz,exampleJsInterop.js.br,MyRcl.<hash>.bundle.scp.css.gz,MyRcl.<hash>.bundle.scp.css.br) are also copied intopublish/wwwroot/_content/MyRcl/.
- Dominant language
- C#
- Stars
- 38.5k
- Forks
- 11.6k
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 289
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/aspnetcore
-
area-networking
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/aspnetcore#70545 · 1 comment ·
Maintainers usually reply within 1 day
-
area-infrastructure
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dotnet/aspnetcore#70524 · 1 comment ·
Maintainers usually reply within 1 day
-
[OpenTelemetry] Hosting replaces an Activity.DisplayName that the app set, when a route matchesOpenarea-hosting Regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/aspnetcore#70516 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[SSE] ServerSentEventsResult.WrapEvents is missing [EnumeratorCancellation], so RequestAborted never reaches the app's generator on the IAsyncEnumerable<T> overloadPossibly taken @bharatprajapati-coder claimed this 1 day ago. Openarea-minimal
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/aspnetcore#70419 · 2 comments ·
Maintainers usually reply within 1 day
-
[Blazor] DefaultInMemoryCircuitPersistenceProvider never disposes the retention CancellationTokenSource when a persist is rejected at capacityPossibly taken @Vinoth2562000 claimed this 1 day ago. Openarea-blazor
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
dotnet/aspnetcore#70418 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in dotnet/aspnetcore
Similar issues
-
bug emitter:client:csharp
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/typespec#12572 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
needs-area-label
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
AWS Lambda: KeyNotFoundException drops HTTP-triggered transactions when allowAllHeaders is disabledOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
newrelic/newrelic-dotnet-agent#3949 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day
-
priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 80/100