Can I get a stack from a CLR exception without adding a VS debugger?

I have a website running on a remote server and I want to get some information from the exception that occurs. I cannot install VS or use remote debugging and try to use different versions of WinDbg with little success. In my local tests, I can force WinDbg to use the C ++ exception or the CLR exception that I selected, but cannot get much more information than “something was thrown”.

Is there a WinDbg way, or is there another way, or am I not suitable for not having proper logging?

+8
debugging windbg iis-6
source share
1 answer

Attach WinDbg to the process, then enter the following commands:

.symfix sxe clr sxd av .loadby sos clr g 

Execution will continue (after the go command) and will be interrupted whenever a CLR exception is thrown (or any other unhandled exception). Whenever it breaks when CLR is thrown, you see:

 (xxxx.xxxx): CLR exception - code e0434352 (first chance) 

You can then use SOS commands such as !pe to print the exception type !ClrStack to dump !dso to delete managed objects on the stack, etc.

EDIT: I had typos in the sxe and sxd . Thanks @MStodd for this.

+14
source share

All Articles