Microsoft.Toolkit.Win32
Microsoft.Toolkit.Win32 copied to clipboard
[WebView] UnobservedTaskException: RPC_E_SERVER_DIED when calling CreateWebViewControlAsync
While inspecting occasional crashes of our WPF app (a few clients reported that issue, although I was not able to reproduce it on developer issue) I found that crashes are caused by an UnobservedTaskException bubbled from the WebView component. So I've added logging for all unobserved exceptions and here is the full exception (it is always the same):
Exception:
System.Exception: The callee (server [not server application]) is not available and disappeared; all connections are invalid. The call may have executed. (Exception from HRESULT: 0x80010007 (RPC_E_SERVER_DIED))
Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess
Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
File "d:\a\1\s\WebView.Shared\Interop\WinRT\WebViewControlProcess.cs", line 96, col 13, in CreateWebViewControlHostAsync
Module "System.Runtime.CompilerServices.TaskAwaiter", in ThrowForNonSuccess
Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
File "d:\a\1\s\Microsoft.Toolkit.Wpf.UI.Controls.WebView\WebView.cs", line 789, col 25, in MoveNext
Could you please help? Because that exception is fired from the WebView component, I'm not able to deal with it... of course, I can prevent app crashes by calling the UnobservedTaskExceptionEventArgs.SetObserverd()
in the TaskScheduler.UnobservedTaskException
, but then the WebView doesn't work until the app is manually restarted.
@pagoe-msft ⬆️
This issue was already reported here: #223 But interestingly this issue was closed without any fix or any comment why it's being closed.