MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Unhandled exception in Microsoft.Web.WebView2.Wpf.WebView2.Dispose

Open
#3,752 10 comments 0 reactions 1 assignee View on GitHub

@LiangTheDev is already working on this.

Since Aug 31, 2023.

bug tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

As this happened once on a client machine, all I can give you is the error as it was logged in the Event Viewer:
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidCastException
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(System.Object, IntPtr, IntPtr ByRef, Boolean ByRef)
at Microsoft.Web.WebView2.Core.Raw.ICoreWebView2Controller.get_CoreWebView2()
at Microsoft.Web.WebView2.Core.CoreWebView2Controller.get_CoreWebView2()
at Microsoft.Web.WebView2.Wpf.WebView2.Uninitialize(Boolean)
at Microsoft.Web.WebView2.Wpf.WebView2.Dispose(Boolean)
at System.Windows.Interop.HwndHost.Finalize()

The next message in the event viewer then reads:
Faulting application name: our application here, time stamp: 0x64ef3c24
Faulting module name: KERNELBASE.dll, version: 6.3.9600.20772, time stamp: 0x639ac196
Exception code: 0xe0434352
Fault offset: 0x000000000000450c
Faulting process ID: 0x27938
Faulting application start time: 0x01d9dbe18e73726f
Faulting application path: path to our application
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report ID: 223dcf3a-47e4-11ee-84bb-40e2303bce86
Faulting package full name:
Faulting package-relative application ID:

Version
SDK: 10.0.22621.755
Runtime: 109.0.1518.115
Framework: .NET Framework 4.8, WPF
OS: Windows 8.1 Pro

Please note that I have Runtime 116.0.1938.62 on my own machine and I did notice an occasional error being raised during debugging but it never caused our application to crash so I never paid a lot of attention to it. Sorry. My own machine is Windows 11 22H2

Regression
Was this working before but has regressed? Unsure
If yes, what version did this last work on? Unsure

Repro Steps
Unsure. User stated the application just "crashed"

Not available

AB#46359270

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.