Skip to content
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

Uncaught (in promise) Error: System.Globalization.CultureNotFoundException: Culture is not supported. (Parameter 'name') ���� is an invalid culture identifier. #28272

Closed
paulguz opened this issue Dec 1, 2020 · 9 comments
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: No Recent Activity

Comments

@paulguz
Copy link

paulguz commented Dec 1, 2020

We are frequently seeing the error "Uncaught (in promise) Error: System.Globalization.CultureNotFoundException: Culture is not supported. (Parameter 'name')
���� is an invalid culture identifier." at various times in our Blazor .Net 5 Wasm application.

"����" changes each time the error happens, but is always a set of nonsense characters.

The error is inconsistent. It occurs in different places in our application on different developers machines. However, it does occur in different browsers (Edge, Chrome, Firefox) on each machine in the same place. It always occurs immediately after some user interaction.

We do use localised resources, but we're not doing anything directly with Culture. The error does not directly eminate from our code.

Our application is embedded in an iFrame, as we slowly move our JavaScript SPA over to Blazor. Therefore there is some communication occurring via JavaScript from the parent to the embedded Blazor app in the iFrame.

I can't share our application with you (it's way too complex), and there's no way I can demonstrate it in a vanilla app because it's happening at random places. It does not occur when the application is published in Release configuration, with trimming and compression enabled.

Here is the full exception:

blazor.webassembly.js:1 Uncaught (in promise) Error: System.Globalization.CultureNotFoundException: Culture is not supported. (Parameter 'name')
���� is an invalid culture identifier.
   at System.Globalization.CultureInfo.GetCultureInfo(:53373/String name)
   at System.Reflection.AssemblyName.FillName(:53373/MonoAssemblyName* native, String codeBase, Boolean addVersion, Boolean addPublickey, Boolean defaultToken)
   at System.Reflection.AssemblyName.Create(:53373/IntPtr monoAssembly, String codeBase)
   at System.Reflection.RuntimeAssembly.GetName(:53373/Boolean copiedName)
   at :53373/System.Reflection.Assembly.GetName()
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.AssemblyKey..ctor(:53373/Assembly assembly)
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.<>c__DisplayClass12_0.<GetRequiredLoadedAssembly>b__0(:53373/Assembly a)
   at System.Linq.Enumerable.TryGetLast[Assembly](:53373/IEnumerable`1 source, Func`2 predicate, Boolean& found)
   at System.Linq.Enumerable.LastOrDefault[Assembly](:53373/IEnumerable`1 source, Func`2 predicate)
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.GetRequiredLoadedAssembly(:53373/AssemblyKey assemblyKey)
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.ScanAssemblyForCallableMethods(:53373/AssemblyKey assemblyKey)
   at System.Collections.Concurrent.ConcurrentDictionary`2[[Microsoft.JSInterop.Infrastructure.DotNetDispatcher.AssemblyKey, Microsoft.JSInterop, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Collections.Generic.IReadOnlyDictionary`2[[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.ValueTuple`2[[System.Reflection.MethodInfo, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Type[], System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].GetOrAdd(:53373/AssemblyKey key, Func`2 valueFactory)
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.GetCachedMethodInfo(:53373/AssemblyKey assemblyKey, String methodIdentifier)
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.InvokeSynchronously(:53373/JSRuntime jsRuntime, DotNetInvocationInfo& callInfo, IDotNetObjectReference objectReference, String argsJson)
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet(:53373/JSRuntime jsRuntime, DotNetInvocationInfo invocationInfo, String argsJson)
    at Object.endInvokeDotNetFromJS (blazor.webassembly.js:1)
    at Object.invokeJSFromDotNet (blazor.webassembly.js:1)
    at Object.w [as invokeJSFromDotNet] (blazor.webassembly.js:1)
    at _mono_wasm_invoke_js_blazor (dotnet.5.0.0.js:1)
    at do_icall (:53373/<anonymous>:wasm-function[10595]:0x194e46)
    at do_icall_wrapper (:53373/<anonymous>:wasm-function[3305]:0x79df6)
    at interp_exec_method (:53373/<anonymous>:wasm-function[2155]:0x44ad0)
    at interp_runtime_invoke (:53373/<anonymous>:wasm-function[7861]:0x12efed)
    at mono_jit_runtime_invoke (:53373/<anonymous>:wasm-function[7346]:0x118e4d)
    at do_runtime_invoke (:53373/<anonymous>:wasm-function[3304]:0x79d3f)

Further technical details

  • ASP.NET Core version: 5.0.100

  • Include the output of dotnet --info:
    Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 5.0.0-rc.2.20475.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 5.0.0-rc.2.20475.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 5.0.0-rc.2.20475.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

  • The IDE (VS / VS Code/ VS4Mac) you're running on, and it's version:
    Visual Studio 16.8.2

@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Dec 1, 2020
@mkArtakMSFT
Copy link
Member

Thanks for contacting us.
Unfortunately this is a type of an error that we can do nothing about without a reproducible project. If you are able to create one and share with us, we would investigate that. Please note, that it can't be a real project, rather a minimal set of changes from the new project template.

/cc @lewing did you see something similar?

@mkArtakMSFT mkArtakMSFT added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Dec 1, 2020
@lewing
Copy link
Member

lewing commented Dec 1, 2020

@mkArtakMSFT looks like a duplicate of dotnet/runtime#43402

@Akinzekeel
Copy link

I'm also seeing this exception in my project sometimes, however it is a plain Blazor WebAssembly project with as little JS as possible. Perhaps we can isolate a common denominator in our projects to find the culprit.

I do use localization via Resources/Resx in both the Blazor project itself as well as in referenced assemblies.

@ghost
Copy link

ghost commented Dec 7, 2020

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

@paulguz
Copy link
Author

paulguz commented Dec 7, 2020

Please don't close this issue yet. I just need to find some time to reproduce the issue in a new project. @Akinzekeel, are you able to do the same?

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: No Recent Activity labels Dec 7, 2020
@mkArtakMSFT
Copy link
Member

@paulguz is there more than what the above mentioned issues tracks already that you want to point out here? If not, please close this one and use the referenced one to provide more information.

@mkArtakMSFT looks like a duplicate of dotnet/runtime#43402

@mkArtakMSFT mkArtakMSFT added Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Dec 7, 2020
@lewing
Copy link
Member

lewing commented Dec 10, 2020

@paulguz you should be able to verify that this is fixed by installing 5.0.101 now.

@lewing
Copy link
Member

lewing commented Dec 11, 2020

You may need to remove any sdk later than 5.0.101 due to dotnet/installer#9208 to test

@ghost
Copy link

ghost commented Dec 15, 2020

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

@ghost ghost closed this as completed Dec 18, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 17, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: No Recent Activity
Projects
None yet
Development

No branches or pull requests

5 participants