-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Problem/Bug]: Process holding webview2 when deleting profile #4384
Comments
@peiche-jessica any update on this? |
Hey there, could you please clarify why you don't always have access to the profile object? If you have access to the wpf WebView2 control, you can get the profile object via |
We do not always have the profile object because we want to delete the user profiles when the user logs out of our desktop app. When logging out of the desktop app the user may or may not have opened the webview window or they might have closed it after opening it. When the webview window is not open we don't have the profile object, but we still want to delete the user profile object. This is the reason for trying to delete it manually and getting the error mentioned when deleting the profile folder at times. |
When the window is closed, webview process might still be alive for a short period of time. You can check if there's still |
I am running into this as well. Even with code like this:
From the Deleted event documentation (and my experience), it seems like it triggers right when Delete() is called, before the deletion is actually finished. If that's true, then that event seems misnamed. And not as useful as an event that triggers when the profile is actually deleted (and/or the msedgewebview2.exe child process terminates). Now I'm going to look up how to monitor a named child process for closing... |
Related #4628 |
What happened?
I have webview2 running on wpf. After closing the webview2 window and after window closing event is received and completed, we are deleting the contents of the webview2 profile folder.
We are getting a
What other process could be holding onto the profile files when the webview2 window is already closed?
This does not always happen and hence hard to reproduce locally. We see this happening in prod instances. We cannot call
CoreWebView2Profile.Delete
method because we may not always have access toCoreWebView2Profile
.How can we find what the issue is and properly delete the webview2 profile folder all the time?
Importance
Moderate. My app's user experience is affected, but still usable.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
121.0.2277.128
SDK Version
1.0.2210.55
Framework
WPF
Operating System
Windows 10
OS Version
No response
Repro steps
Try closing webview2 window running in wpf and deleting the contents of the webview2 profile folder programmatically. Repeat this multiple times and note that an io exception is thrown because the folder contents cannot be deleted because another process is holding onto it.
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered: