Page 1 of 1

Initialization Error

Posted: Mon Dec 12, 2022 9:04 am
by 312684696
InitializationError
There was an error creating the controller. (2)
Error code : 0x8007139F
Another browser is using the same user data folder.

What caused this error?

Re: Initialization Error

Posted: Mon Dec 12, 2022 9:49 am
by salvadordf
Hi,

This might be caused by two instances of the same application trying to use the same user data folder.

Read these pages for all the information :
https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2environment?view=webview2-1.0.1462.37#createcorewebview2controller
https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/user-data-folder?tabs=win32

Re: Initialization Error

Posted: Mon Dec 12, 2022 10:35 am
by 312684696
i have set ExclusiveUserDataFolderAccess=false

Why still prompt this error?

Re: Initialization Error

Posted: Tue Dec 13, 2022 1:18 am
by 312684696
salvadordf wrote: Mon Dec 12, 2022 9:49 am Hi,

This might be caused by two instances of the same application trying to use the same user data folder.

Read these pages for all the information :
https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2environment?view=webview2-1.0.1462.37#createcorewebview2controller
https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/user-data-folder?tabs=win32
i have set ExclusiveUserDataFolderAccess=false

Why still prompt this error?

Re: Initialization Error

Posted: Tue Dec 13, 2022 8:31 am
by salvadordf
This is what the documentation says about that property :
https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2environmentoptions2?view=webview2-1.0.1462.37
The ExclusiveUserDataFolderAccess property specifies that the WebView environment obtains exclusive access to the user data folder. If the user data folder is already being used by another WebView environment with a different value for ExclusiveUserDataFolderAccess property, the creation of a WebView2Controller using the environment object will fail with HRESULT_FROM_WIN32(ERROR_INVALID_STATE). When set as TRUE, no other WebView can be created from other processes using WebView2Environment objects with the same UserDataFolder. This prevents other processes from creating WebViews which share the same browser process instance, since sharing is performed among WebViews that have the same UserDataFolder. When another process tries to create a WebView2Controller from an WebView2Environment object created with the same user data folder, it will fail with HRESULT_FROM_WIN32(ERROR_INVALID_STATE).

Re: Initialization Error

Posted: Wed Dec 28, 2022 5:39 am
by 312684696
https://github.com/MicrosoftEdge/WebView2Feedback/issues/3029