views:

54

answers:

3

Hi All,

I am working on a sub project(.NET) which deals with exceptions. Below is my requirement

When an exception occurs, the exception assembly must capture

  1. CPU information
  2. Method which caused the issue
  3. Data which caused the issue
  4. Environment details (path and other information)

In above all these, the toughest part would be getting the data which caused the issue.

The data could be stored anywhere within the method body. it could be method parameters, local variables, objects etc. I believe there is no interface available in .Net which can expose the data in the memory at the time of exception. so I was thinking of taking mini dumps during the exception. Is it possible in .Net to create mini dumps.

my software env is. .Net 3.5, WCF, Silverlight

do pass me some links.

thanks

A: 

I wrote a managed console app that calls the native API for creating minidumps. I posted it here: Complete Minidump code

It is actually rather easy. The hardest part really, is just determining what name you want to name your minidump file.

C Johnson
A: 

Debugger support for managed code dumps created via the methods described in other answers is (or was) limited - see @Jaredpar's info here.

Supposedly Visual Studio 2010 supports this though, per info here.

The Visual Studio 2010 debugger can read dump files that contain information about managed code, unmanaged code, or a mixture of both. You can debug both native and managed dumps using the normal debugging windows.

FYI you can set up Process Dumper to trigger process dump on selected native exceptions - not sure how this works in a managed process though. fwiw I see no reason why a native exception would not trigger the dump just the same since it's happening outside the scope of the CLR (in native code stackframe), nor why such a dump could not be handled in VS2010.

Steve Townsend