Generating dump files

  • Thread starter Thread starter Marcin Rzeznicki
  • Start date Start date
M

Marcin Rzeznicki

Hello,
Is it possible to generate dump file at some execution point in managed
application? I would like to be able to gather information about
exceptions and their context from users running my app - if I handle
some relevant exception, besides informing user of failure, I'd like to
enable him to send me dump file in order to analyze what actually went
wrong and perform some maintenance/debugging on my own. It would be
also nice if I could generate dump post-mortem - when application
crashes due to unhandleld exception. Do you have any ideas or
guidelines concerning this issue?
 
Simply create a text file using a StreamWriter object and call it's
Writeline() mthod using the trapped exception:

<object>.Writeline(<exception>.ToString());

The ToString() method of a class derived from System.Exception, by default
includes a stack trace.

If the executable is a 'debug' build, the stack trace also includes the
source file and line number.

Any other information you wish to include in the 'dump' is purely up to you.
 
Sounds like you want something more hardcore than ex.ToString()

An article on how to get memory dumps from asp.net that really helped me is:
http://blogs.msdn.com/tess/archive/2006/01/11/511773.aspx
(this is a fantastic blog by the way)

Other useful resources:
Mini Dump Snapshots and the New SOS
http://msdn.microsoft.com/msdnmag/issues/05/03/Bugslayer/

Production Debugging for .NET Framework Applications

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/DBGch01.asp


Hope that helps
 
Chris Mohan napisal(a):
Sounds like you want something more hardcore than ex.ToString()

An article on how to get memory dumps from asp.net that really helped me is:
http://blogs.msdn.com/tess/archive/2006/01/11/511773.aspx
(this is a fantastic blog by the way)

Other useful resources:
Mini Dump Snapshots and the New SOS
http://msdn.microsoft.com/msdnmag/issues/05/03/Bugslayer/

Production Debugging for .NET Framework Applications

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/DBGch01.asp

Hello,
Thank you very much for help - I'm going to experiment with tools
described in these links.
 
Stephany Young napisal(a):
Simply create a text file using a StreamWriter object and call it's
Writeline() mthod using the trapped exception:

<object>.Writeline(<exception>.ToString());

The ToString() method of a class derived from System.Exception, by default
includes a stack trace.

If the executable is a 'debug' build, the stack trace also includes the
source file and line number.

Any other information you wish to include in the 'dump' is purely up to you.

Hello,
Sure it's up to me, but using this oversimplified technique I won't be
able to check actual arguments of method causing exception, examine
objects on heap and so on. What I need is something acting like Mozilla
Talkback, which activates itself when application crashes and dumps
process memory sending it to developers for further examination.
 
Back
Top