MicrosoftEdge / MicrosoftEdge/WebView2Feedback
WebView2 Unresponsive Errors with Interop
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Description
I'm running into a lot of problems with customers getting errors that result in CoreWebView2_ProcessFailed which report the control is unresponsive.
It seems to be related to operations that run simultaneously across multiple WebView controls. My scenario is basically that I have two WebView controls 1 with an HTML based editor and one with a preview. With the errors report I see a pattern where the errors always occur when a new document is rendered in the preview, immediately after (or perhaps simultaneously with an async fire and forget call) updating the editor via Interop.
private static void CoreWebView2_ProcessFailed(object sender, CoreWebView2ProcessFailedEventArgs e)
{
MessageBox.Show(mmApp.Model.Window,
"The Preview WebView Control has failed and the application has to shut down. Please restart Markdown Monster.",
"Shutdown Notice",
MessageBoxButton.OK, MessageBoxImage.Error);
mmApp.Log($"Preview WebView Control Process Failed: {e.ProcessFailedKind} {e.Reason}",
logLevel: LogLevels.Critical);
Environment.Exit(1);
}
One problem here is that there's no information at all on what the problem is. It doesn't give any other information other than Unresponsive and RenderProcessUnresponsive which isn't very helpful.
Any more information on why this might be happening or whether others are seeing these types of errors crop up?
I'm looking at code instances as the errors come in and one pattern I see is that it's always in scenarios where a change is made to the editor and a new document is loaded into the previewer (as opposed to updating an existing document via DOM which is much more common and doesn't fail).
This ties back perhaps to the error I reported last week regarding setTimeout() not firing in some scenarios which was also related to a new document load in another instance. It seems that the WebView (or the control marshalling into the WPF host) has problems when two WebViews have simultaneous operations going on, but from my end this is just an observation not anything I can back up with repeatable proof. The errors are incredibly inconsistent - I've seen them very, very rarely myself, but have not been able to replicate them with any consistency.
**Versions: **
Errors trapped were with the last 1.0.8xx versions of runtime and WPF control. I've since switched to the 1.0.9xx runtimes and controls but need to wait to see if that makes a difference
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CoreWebView2_ProcessFailed handler and the editor-to-preview flow described in the issue, especially the async interop call and new document load across two WebView controls. Reproduce the inconsistent RenderProcessUnresponsive failure if possible and compare behavior across the 1.0.8xx and 1.0.9xx runtime and WPF control versions. Done means identifying a repeatable cause or documenting the missing diagnostic information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100