0

This is my program's basic Information:

  • WPF Application
  • Target Framework: 4
  • Platform Target: Any CPU

Now when I try to open a file dialog I get a FatalExecutionEngineError.

This is my code:

Microsoft.Win32.OpenFileDialog OF = new Microsoft.Win32.OpenFileDialog();
OF.Filter = " All File (*.*)|*.*";

bool? res = OF.ShowDialog();

if (res == true)
{
// Do Some Code
}

Error Discription:

FatalExecutionEngineError was detected
Message: The runtime has encountered a fatal error. The address of the error was at 0xe80fc200, on thread 0x1fbc. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

4

1 回答 1

0

使用System.Windows.Forms.OpenFileDialog代替Microsoft.Win32.OpenFileDialog

于 2012-10-19T12:23:11.487 回答