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.
seva titov
source share