title: _CRT_DEBUGGER_HOOK throws exception
body: <p>I'm having a problem converting my program from VS2005 to VS2008. When I run
  the program in VS2008, the application starts up fine but when start playing
  around with the application it crashes giving me this error:</p>
  
  <p>"Microsoft Visual Studio C Runtime Library has detected a fatal error"</p>
  
  <p>And then the debugger points me to this function:</p>
  
  <pre><code>__declspec(noinline)
  void __cdecl _CRT_DEBUGGER_HOOK(int _Reserved)
  {
  /* assign 0 to _debugger_hook_dummy so that the function is not folded
  in retail */
  (_Reserved);
  _debugger_hook_dummy = 0;
  }
  </code></pre>
  
  <p>compiling the application ase release works prefectly...  </p>
  
  <p>By the way, this is a native code calling a managed c++ code that wrapps .NET code.</p>
  
  <p>How can I debug such situation ? </p>
  
  <p>Ofer</p>