MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Restarting multiple WPF webview results in exception when calling EnsureCoreWebView2Async

Open
#2,065 1 comment 0 reactions 1 assignee View on GitHub

@champnic is already working on this.

Since Jan 11, 2022.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Description
Restarting multiple WPF processes each containing a single webview (single browser process) results in error when calling EnsureCoreWebView2Async.

Version
SDK: 1.0.1054.31
Runtime: 94.0.992.50
Framework: WPF
OS: Win10

Repro Steps
Start multiple WPF apps each containing a single webview instance.
On startup of each navigate to a web page.
Shutdown all the apps programmatically and start them again.
They will fail once restarted with exception:
System.Runtime.InteropServices.COMException (0x800700AA): The requested resource is in use. (Exception from HRESULT: 0x800700AA)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.Web.WebView2.Core.CoreWebView2Environment.d__54.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Web.WebView2.Wpf.WebView2.<>c__DisplayClass27_0.<g__Init|0>d.MoveNext()

Additional context
It does not happen when each has a separate user data folder but that is way too much overhead as we can have many apps.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.