MicrosoftEdge/WebView2Feedback

[Problem/Bug]: Multiple Browser Instances Sharing User Data Folder Cannot Have Different Settings

vrad-joshuamckelvey opened this issue · 7 comments

What happened?

WebView2 fails to launch when two WebView2 browser instances are sharing the same User Data Folder with differing CoreWebView2EnvironmentOptions.AllowSingleSignOnUsingOSPrimaryAccount values.

The second browser throws the error below:

System.Runtime.InteropServices.COMException: 'The group or resource is not in the correct state to perform the requested operation. (Exception from HRESULT: 0x8007139F)'

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

125.0.2535.67

SDK Version

1.0.2535.41

Framework

Winforms

Operating System

Windows 11

OS Version

10.0.22631

Repro steps

  1. Launch WebView2 in dialog with CoreWebView2EnvironmentOptions.AllowSingleSignOnUsingOSPrimaryAccount set to false.
    L2. Launch WebView2 in another dialog with CoreWebView2EnvironmentOptions.AllowSingleSignOnUsingOSPrimaryAccount set to true.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Regression in newer Runtime

Last working version (if regression)

124.0.2478.109

I can provide a demo application as well if that would help.

It should be by design - it is browser feature. If you are running wv2 with the same UDF they share browser process. Could you please double check that it is working in 124?

@vbryh-msft We have an app which can accept Chromium command line args and pass them through to the WebView2 environment here when creating the environment (the AdditionalBrowserArguments property).

This apps uses the same UDF with different profiles.

This app can run on a server where there are multiple shortcuts running it with different command line arguments that we pass through and multiiple instances of the app running at a time. This leads to this crash.

What is your recommendation for how we can address this? Is our only option to not reuse the user data folder? (we were also thinking to catch this exception and recreate the environment with a secondary UDF to avoid the crash)

About webview2 process model - just to make sure we are on the same page.
Multiple profiles for the same UDF are ok.
Just a note, because server with shortcuts was mentioned - Avoid storing user settings on a network drive. This can result in slowdowns, crashes, or loss of data - link.
What are different command line arguments, which are needed?

@vbryh-msft I am using separate profiles but still get this crash. An example is --disable-smooth-scrolling

(I work with @pushkin- on this project.) Is the point that our single UDF (despite the separate profiles) means there's only one browser process, shared by multiple (otherwise separate) instances of our app?

yes - I have linked a doc .