1

In my .NET4 application I call MiniDumpWriteDump() on Application.ThreadException and AppDomain.CurrentDomain.UnhandledException.

When I run the app in the debugger (VS10) I get a perfect dump, but when I run it standalone the dump file is empty.

Any ideas?

EricSchaefer
  • 25,272
  • 21
  • 67
  • 103
  • Ths thread http://stackoverflow.com/questions/1134048/generating-net-crash-dumps-automatically points to a number of ways of doing this. Can you see if any of the ideas helps? I note that the doco on MSDN for MiniDumpWriteDump() says you shouldn't call it from the process itself. Perhaps this is why it works in the debugger only? – Preet Sangha Aug 27 '12 at 10:09
  • As I noted [here](http://stackoverflow.com/a/1135666/21567) it is generally not a good idea to capture the minidump from the (failing) application itself. Especially not this "MiniDumpWriteDump may not produce a valid stack trace for the calling thread" from [MSDN](http://msdn.microsoft.com/en-us/library/ms680360%28VS.85%29.aspx). – Christian.K Aug 27 '12 at 10:12
  • Everybody talks about writing the dump from another process but I have never seen working code for this. How do you get all the exception information into the new process? Command line? – EricSchaefer Aug 27 '12 at 10:24
  • Basically, you register your (watchdog) process as a JIT debugger (like Dr. Watson or even Visual Studio itself does). It will then get all the necessary information via the debugging APIs it implements. You might also want to have a look at [SuperAssert](http://msdn.microsoft.com/en-us/magazine/cc188701.aspx) by Wintellect. – Christian.K Aug 27 '12 at 11:23

0 Answers0