Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Initialization Error

Post Reply
312684696
Posts: 11
Joined: Wed Jun 08, 2022 3:38 am

Initialization Error

Post 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?
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Initialization Error

Post 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
312684696
Posts: 11
Joined: Wed Jun 08, 2022 3:38 am

Re: Initialization Error

Post by 312684696 »

i have set ExclusiveUserDataFolderAccess=false

Why still prompt this error?
312684696
Posts: 11
Joined: Wed Jun 08, 2022 3:38 am

Re: Initialization Error

Post 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?
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Initialization Error

Post 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).
312684696
Posts: 11
Joined: Wed Jun 08, 2022 3:38 am

Re: Initialization Error

Post by 312684696 »

https://github.com/MicrosoftEdge/WebView2Feedback/issues/3029
Post Reply