2

I wanted to know if there is a possibility to dump all stack variable when an exception occurs in .NET 4 so I can analyze it later (in production serveR)

Thanks

Himberjack
  • 5,682
  • 18
  • 71
  • 115

4 Answers4

3

There are some resources around.

See Writing Minidumps in C#. Minidumps later can be analyzed either in WinDbg or in VS 2010.

You may also interested in Is it impossible to show forms when handling a AppDomain.CurrentDomain.UnhandledException? and What is the best way to collect crash data?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Nick Martyshchenko
  • 4,231
  • 2
  • 20
  • 24
1

The StackTrace class is intended to do this.

You can also gather important information like the source file, position, running thread, the method in which the crash occured etc.

VVS
  • 19,405
  • 5
  • 46
  • 65
0

Have you checked the windows event log, usually exceptions are logged there with all the details you're asking for.

CodingGorilla
  • 19,612
  • 4
  • 45
  • 65
0

windbg can do this.

See details on this blog.

Oded
  • 489,969
  • 99
  • 883
  • 1,009