开发者

A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in WindowsBase.dll

开发者 https://www.devze.com 2023-03-11 18:50 出处:网络
I have a .NET 4.0 WPF project. When I open a FileDialog, choose some files and press the OK button, then I see in the output window this error:

I have a .NET 4.0 WPF project.

When I open a FileDialog, choose some files and press the OK button, then I see in the output window this error:

A first chance exception of type 'Sy开发者_如何学JAVAstem.ComponentModel.Win32Exception' occurred in WindowsBase.dll

OpenFileDialog fileDialog = new OpenFileDialog();
            fileDialog.Multiselect = true;

            DialogResult result = fileDialog.ShowDialog();
            if (result == DialogResult.OK)
            {

Why do I get that Exception before the if-statement?


It sounds like you're seeing a Win32Exception which was raised and handled within the WPF application stack. I've seen this happen many times when debugging WPF applications. They make API calls which can fail, handle the exception and continue processing.

It's nothing to be concerned about unless the exception makes it way back to your code.

0

精彩评论

暂无评论...
验证码 换一张
取 消