Closed RobertGlobant20 closed 3 months ago
Hi, @RobertGlobant20!
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!
Hi, @RobertGlobant20!
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!
There is no crash dump or stacktrace info due that is suddently closing. I've checked EBWebView\Crashpad\reports\ and is empty
This is a GIF showing the behavior.
Try this. This seems to solve the issue.
public async Task<string> OpenFile()
{
//Make the method async
//Add this line to make the method async
await Task.Yield();
var dialog = new OpenFileDialog();
if (dialog.ShowDialog() == DialogResult.OK)
{
return dialog.FileName;
}
return "";
}
Ok thanks for the help, I just tested and is working as expected. Then as a resume of the fix seems that if we want to open a dialog from the js code (webpage being displayed in WebView2) we need to call async methods and use the await inside the code.
I will proceed to close this issue due that the solution provided fixed our problem. Thanks
What happened?
I've created a simple WebView2 app displaying a very simple React component, the component has a button that when is clicked send a message to .NET to open a FileOpen Dialog, after some seconds of the Dialog being opened the application freeze (both the .NET app and the File Explorer Dialog), then the app suddently closes.
In the EventViewer->Windows Logs->Application I've found an Error Entry that says:
This behavior is reproducible in any WebView2 app that opens a FileOpen Dialog
This is the sample repo that you can use to reproduce the crash. https://github.com/RobertGlobant20/WebView2OpenDialogTester
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
126.0.2592.69
SDK Version
1.0.2592.51
Framework
WPF
Operating System
Windows 10
OS Version
19045.4529
Repro steps
<button>Click Me</button>
)chrome.webview.postMessage("Message")
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