I am using the swa cli
to deploy my NET8 Blazor WASM app to an Azure Static Web App site. The deployment finishes successfully according to the cli, and I am also to run that app just fine locally.
When I open the browser at the web page of the static wep app. The loading indicator (that ring with up to 100%) jsut hangs there and does not continue. When looking into the browser's JS console, I am given the following error message
Error: AggregateException_ctor_DefaultMessage (PlatformNotSupported_HybridGlobalization, HashCode)
callEntryPoint https://myapp.azurestaticapps.net/_framework/blazor.webassembly.js:1
A quick Google search seems to relate that error with Globalization. At first I thought it might have to do something with lcoalization (which I have tried earlier but have not removed from the app). But reading that, it seems to be related to (String)CompareOptions. so sth like string1.Equals(string2, StringComparison.InvariantCultureIgnoreCase))
, but I am using InvariantCulture everywhere with strings. The doc states that not all CompareOptions
are available for non-invariant Cultures.
According to the above doc, Hybrid Globalization is an optimsation feature that must be opted-in by including the following in the csproj, which I have NOT.
<HybridGlobalization>true</HybridGlobalization>
So I dot know what I can do to debug this. Do you have any idea?
I ran into this after .NET 9 was released, so I logged an issue in the ASP.NET Core repo about it here. The fix and a couple of workarounds are:
FIX: Install the .NET 8.0.405 SDK, which was included with the Visual Studio 17.12.4 update per this.
Create a global.json file that explicitly references a .NET 8 SDK version (example). You may need to manually install the SDK because Visual Studio updates only retain the latest .NET SDK. In my case, installing the VS 2022 17.12 update replaced the .NET 8.0.404 SDK with .NET 9.0.100 SDK.
Alternatively, you can upgrade the project to target .NET 9 (example). Then it publishes correctly with the .NET 9.0.100 SDK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With