Skip to content
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]: WebView2 process not disposing #4628

Open
bdovaz opened this issue Jun 14, 2024 · 0 comments
Open

[Problem/Bug]: WebView2 process not disposing #4628

bdovaz opened this issue Jun 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bdovaz
Copy link

bdovaz commented Jun 14, 2024

What happened?

I get this error:

System.IO.IOException: The process cannot access the file 'AssistanceHomeSQLite' because it is being used by another process.

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

1.0.2535.41

Framework

WPF

Operating System

Windows 11

OS Version

No response

Repro steps

I am trying to execute this code:

string webViewUserDataFolder = WebView.CoreWebView2.Environment.UserDataFolder;

int webViewProcessId = Convert.ToInt32(WebView.CoreWebView2.BrowserProcessId);

Process webViewProcess = Process.GetProcessById(webViewProcessId);

WebView.Dispose();

using CancellationTokenSource cts = new(5000);

try
{
   // Never ends
    await webViewProcess.WaitForExitAsync(cts.Token);
}
catch (OperationCanceledException e)
{
}

// This line fails
Directory.Delete(webViewUserDataFolder, recursive: true);

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant