0

In my application, I am creating Edge environment using CreateCoreWebView2EnvironmentWithDetails. Right now it is creating a folder next to my exe as "myexe .WebView2", which I don't want. So I am passing "C:\Users\username>\AppData\Local\MicrosoftEdge as an UserDataFolder. But still it is creating an empty folder "Myexe.webview2" in my application folder.

Here is sample to show how I am passing arguments.

HRESULT hr = CreateCoreWebView2EnvironmentWithDetails(folderName, L"C:\\Users\\<myUSer>\\AppData\\Local\\MicrosoftEdge",  NULL,     Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>

I knew that edge creates a folder in app local folder as an default location when NULL is passed for UserDataFolder. But here I am giving location for UserDataFolder.

So the questions are:

Why is it creating an empty folder with name "myexe.WebView2" in default location, when I am passing "userDataFolder"?

What should I do to avoid that?

Update: We have been using this version for a while. Upgrading to latest version will be done in future. For now, the code uses CreateCoreWebView2EnvironmentWithDetails.

TippuR
  • 113
  • 2
  • 12
  • Since `CreateCoreWebView2EnvironmentWithDetails` is deprecated and replaced with `CreateCoreWebView2EnvironmentWithOptions`, perhaps you can find a solution in there? – Ted Lyngmo Oct 19 '20 at 19:30
  • Well, if you insist on using deprecated versions, then you must accept its limitations. Actually they have released the first non-preview version today, I suggest you upgrade. – Poul Bak Oct 19 '20 at 22:04
  • If that is a limitation, I can accept it. I want to be sure that I am not missing any API calls or forgot to set something, which can lead to empty folder creation – TippuR Oct 19 '20 at 22:36
  • Well, I have not seen it using the new version, so you may call it a bug in the old versions. Anyway, you will have to make other changes too, when you upgrade. – Poul Bak Oct 19 '20 at 22:42

1 Answers1

2

What you describe is a bug. If you still see this behavior with the latest SDK, please open an issue against our WebView2 feedback GitHub repo and we can look into it. Thanks!

David Risney
  • 3,886
  • 15
  • 16