SteveSandersonMS / WebWindow

.NET Core library to open native OS windows containing web UI on Windows, Mac, and Linux. Experimental.
Apache License 2.0
1.98k stars 215 forks source link

ProjectName.WebView2 folder. Is it required? #34

Closed kevinjpetersen closed 4 years ago

kevinjpetersen commented 4 years ago

I'm currently testing out the project, however I've noticed some odd behavior when it comes to the folder "ProjectName.WebView2" (ProjectName being the name of your Project). This folder is automatically created upon a build, however it is not created if it's published as a Single Executable.

Now. It's about to get weirder.

In the case of the Single Executable, when I start the executable, the folder "ProjectName.WebView2" is created with lots of content inside it. As long as the program is open, you cannot delete this folder.

However after you've done these steps, and then close the program and delete the folder "ProjectName.WebView2", and then re-execute the program, the folder does NOT reappear/recreate- itself, meaning it is not required?

If this really IS required. Is it possible to include it into the Single Executable somehow?

Berrysoft commented 4 years ago

The folder is created by WebView2, obviously, and shouldn't be included if you publish your program (because it may contains your own private cache). If you delete it, it WILL be recreated the next time you run the program.

The folder is necessary in the run time, and you can test that easily: Create a file named "ProjectName.WebView2", and set it to read-only. Then the program cannot run successfully.

SteveSandersonMS commented 4 years ago

Thanks for answering, @Berrysoft!