Closed aries-zhang closed 1 month ago
Hi, @aries-zhang!
It seems that your issue contains the word "crash". If you have not already, could you attach a crash dump as a comment?
WV2 crash dumps are located in a subfolder of the app's user data folder (UDF): <UDF>\EBWebView\Crashpad\reports\
. By default, the user data folder is created in the app's folder with a name like <App Exe Name>.exe.WebView2
. Refer to Crash Diagnostics for more information.
Thank you for your cooperation!
No file exists under <UDF>\EBWebView\Crashpad\reports\
.
Hi @aries-zhang , can you please provide the SDK version number in the bug template?
Hi @oggy22 if you mean WinAppSDK version number it is 1.6.240829007 (project link).
There is no WebView2 SDK involved in this case since it's just a <WebView2 />
element in XAML.
Please see this issue in WinUI 3 repo for workaround: https://github.com/microsoft/microsoft-ui-xaml/issues/7632.
Explicitly disposing WebView2 by calling TheWebView2Instance.Close()
when app closes fixes the issue.
What happened?
With the following minimal XAML code in a skeleton WinUI 3 app created with the VisualStudio template "Blank App, Packaged with Windows Application Package Project (WinUI 3 in Desktop)":
The app crashes with the following exception when it is closed:
The exception does not occur with the same code in a project created with the template "Blank App, Packaged (WinUI 3 in Desktop)".
Please see the code in this repo: https://github.com/aries-zhang/winui3-adventure/tree/main/closing-exception-with-webview2
PackagedWithSameProject is for the 2nd scenario where the app does not crash on closing. PackagedWithSeparateWapProject is for the 1st scenario where the issue repros.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
128.0.2739.79
SDK Version
No response
Framework
WinUI3/WinAppSDK
Operating System
Windows 11
OS Version
23H2
Repro steps
Create a new project in Visual Studio (2022) with the template "Blank App, Packaged with Windows Application Package Project (WinUI 3 in Desktop)".
Open MainWindow.xaml in the new project, remove the
<StackPanel ...> ... </StackPanel>
code, add the following code:Run the app in Visual Studio with "Local Machine". The app should start and load Bing.com.
Close the app, the following exception occurs:
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