第一个机会异常类型的“System.ComponentModel.Win32Exception”在WindowsBase.dll发生第一个、异常、发生、类型

由网友(一種不羈於世的Feelヾ)分享简介:我有一个.NET 4.0的WPF项目。I have a .NET 4.0 WPF project.当我打开一个FileDialog的,选择一些文件和preSS确定按钮,然后我在输出窗口看到以下错误:When I open a FileDialog, choose some files and press the...

我有一个.NET 4.0的WPF项目。

I have a .NET 4.0 WPF project.

当我打开一个FileDialog的,选择一些文件和preSS确定按钮,然后我在输出窗口看到以下错误:

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

有一个第一次机会异常的类型'System.ComponentModel.Win32Exception的在WindowsBase.dll发生

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

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

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

为什么我得到了异常的if语句之前?

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

推荐答案

这听起来像你看到一个 Win32Exception 这是提高和WPF应用程序堆栈中进行处理。我见过调试WPF应用程序时,这种情况发生了很多次。他们让其中可以失败,处理这个异常并继续处理API调用。

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.

这是没有什么可担心,除非例外,使得它的方式回到你的code。

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

阅读全文

相关推荐

最新文章