Contents - Index



Type: Property

Access: Read/Write

Data Type: String


Determines the location of where the WebView2 control creates the user data folder.

The user data folder is used for a variety of things that your web browser control might need to store. 

Think about caching files, but also cookies or even things like the IndexedDB database that a website can use to store data persistently for a website.


If this property is not set, then we will fall back on a default mechanism that is controlled by the DefaultUserDataFolderLocation property. The default behavior is to have the UserDataFolder in the local user temp folder.


The WebView2 control needs to have write access to the location where it creates user data folder, otherwise it cannot be instantiated and will fail with an error.


You can change the location of the UserDataFolder only before you instantiate the first WebView2 control in your application. 

A good spot to do so would be in OnCreate (*).


Please note that your application cannot share the location with another application, as you can then not run these applications simultaneously. 

You are also not allowed to use the location that Microsoft's Edge browser is using.


However you can start the same application more than one time.


More info about the UserDataFolder can be found at Manage the user data folder.



Please note that in DataFlex due to naming conventions this is the OnComCreate event, confusingly DataFlex also has a OnCreate event, but this is send by the runtime and too late in the process for changing the UserDataFolder.