Hybrid Windows crash when using IJSRuntime early on page load
See original GitHub issueVersion: 0.6.18-preview Platform: Windows WPF Exception:
System.InvalidOperationException: AttachToIpcChannel must be called before using IJSRuntime.
at Microsoft.MobileBlazorBindings.WebView.BlazorHybridJSRuntime.ThrowIfIpcNotSet()
at Microsoft.MobileBlazorBindings.WebView.BlazorHybridJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](String identifier, CancellationToken cancellationToken, Object[] args)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](String identifier, Object[] args)
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeAsync[TValue](IJSRuntime jsRuntime, String identifier, Object[] args)
at Hara.WebCommon.JsInteropConfigProvider.GetRaw(String key) in C:\Git\Hara\Hara.WebCommon\JsInteropConfigProvider.cs:line 31
Cause:
When loading a component inside hybrid blazor app inside MBB Windows, that uses IJSRuntime (in my case it is a call to localstorage.get), nested under OnAfterRenderAsync(firstRender) where firstRender is true.
Source: https://github.com/Kukks/Hara/tree/bump-and-fix-windows-support
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
My computer keeps crashing at the windows loading screen
when l start my computer, the windows loading logo appears. after a few seconds, the fans in my computer get really loud and...
Read more >Handle errors in ASP.NET Core Blazor apps
This article describes how Blazor manages unhandled exceptions and how to develop apps that detect and handle errors.
Read more >MAUI apps crash on launch on Windows after Visual ...
The program '[8104] MauiBugCrashOnLaunchOnWindows.exe' has exited with code 2147942405 (0x80070005). The usual steps such as deleting bin and ...
Read more >Windows-based computer freeze troubleshooting
Learn how to troubleshoot computer freeze issues on Windows-based computers and servers. ... Try to use Windows remote administration tools.
Read more >Hogwarts Legacy constantly crashing on PC
The game will still eventually crash depending on your graphics settings tho. First, lower all the graphics settings through GeForce experience.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Kukks I ran exactly into this error. I fix it using xamarin essentials secure storage instead of browser storage when working with native devices. I did a common interface which manage platform storage.
Xamarin essentials is not supported on win32/wpf but a port is being developed
Take a look of this PR
https://github.com/xamarin/Essentials/pull/1079