2007年8月3日

[.Net]Stepping thru a unit test generates MDA FatalExecutionEngineError

I got this error message while implementing a CASmf client in C#. The error occurs while the client tries to invoke a CASmf WIN32 API casmf_recv().

So I google for a while and found this error only occurs in the following situation:
  1. When we are interop debugging. For example when you are invoking Win32 APIs from managed codes
  2. When does a "property eval" of a method that contains a breakpoint. For example when you are "watching" some variables in the debugger.

I totally match above situations, I am interop debugging and there IS a breakpoint on it. So I simply remove the breakpoint, and the clinet works fine.

There are 3 workarounds to this problem:

  1. Remove breakpoints
  2. Disable automatic property eval(ToolsOptions menu in VS2005). Remember that VS automatically calls ToString() method and property getters, so when your watch window is opened, or when you quick watch the code, this will happen.
  3. Use managed debugging only

沒有留言:

Blog Archive

About Me