-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with StaticWebAssets in Blazor WebAssembly Hosted on .NET 9.0 #59466
Comments
@Solbstr thanks for contacting us. Do you have a repro you can share? |
Hi @javiercn, I’ve been working on a fitness app for five years, and after migrating the project to .NET 9.0.101, I encountered build errors related to missing .gz assets. After extensive testing and troubleshooting, I discovered the root cause of the issue. The problem was caused by the following line in the .csproj file of the Client project: <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
<BlazorWebAssemblyLoadGlobalizationDataForCultures>en-US;nb-NO</BlazorWebAssemblyLoadGlobalizationDataForCultures>
<InvariantGlobalization>false</InvariantGlobalization>
<CompressionEnabled>false</CompressionEnabled> <!-- This line caused the issue -->
<BlazorEnableTimeZoneSupport>true</BlazorEnableTimeZoneSupport>
</PropertyGroup> When I commented out or removed the CompressionEnabled property, the project built successfully. It seems this property, when explicitly set to false, causes .gz asset references to be handled incorrectly during the build process. |
@Solbstr thanks for the additional details. That helps a lot, I'm able to reproduce it now. |
It doesn't seem related to a fix that we took for servicing, but we are investigating, maybe something else has changed. From what I can see on the binlog, the asset does not contain the correct definition in this case.
|
This line is the culprit |
Just checked and it reproduces on 9.0 RTM, so it's a bug, but not a regression in any patch fix. |
I encountered a significant issue while building my Blazor WebAssembly Hosted project after migrating to .NET 9.0.101. The build fails with over 200 errors related to missing .gz assets. These errors indicate that .gz files are being searched for in the compressed folder, even though these files were not added or generated during the build process.
The errors are triggered by Microsoft.NET.Sdk.StaticWebAssets.Compression.targets.
The text was updated successfully, but these errors were encountered: