dotnet / dotnet/wpf

In a WPF project using BlazorWebView2, when using saveFileDialog on a Razor page, an exception is thrown after waiting about 30 seconds after the dialog pops up: System.Runtime.InteropServices.SEHException: "External component has thrown an exception."

Open
#11,126 5 comments 1 reaction 0 assignees View on GitHub
External Non-WPF Issue
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

In a WPF project using BlazorWebView2, when using saveFileDialog on a Razor page, if the dialog is open for about 30 seconds, it throws an exception System.Runtime.InteropServices.SEHException: "External component has thrown an exception." The demo project is located at this address:
https://github.com/mmgdh/TestFileDialog.

Image

### Reproduction Steps

1.Click Button “Throw Error Wait 30 Seconds” Invoke OpenFileDialog
2.Wait for a while maybe 30 Seconds
3.Throw Error:System.Runtime.InteropServices.SEHException: "External component has thrown an exception."

### Expected behavior

OpenFileDialog and SaveFileDialog and other file dialog windows can stay open without crashing.

### Actual behavior

Throw Error:System.Runtime.InteropServices.SEHException: "External component has thrown an exception."

### Regression?

Always

### Known Workarounds

_No response_

### Impact

_No response_

### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.