C
Chris Mullins
I'm looking into adding automated mini-dump creation to my companies .NET
software products.
For the past few years, we've been using ADPlus scripts (thank you
BugSlayer!) to setup and catch 2nd Chance Exceptions, generating .NET 1.1
dumps, and then using WinDbg and Son of Strike to track down the culprit
(usually System.DirectoryServices. Ugh.). The problem is that this is a
cumbersome process for clients to go through (many of whom are
non-technical), and generally relies on knowing in advance that an error is
going to happen soon.
Our products are now all migrated to .NET 2.0, which has the new method
"Environment.FailFast". The documentation on this little gem is quite
scarce, and I'm trying to determine the best practices for using it. I'm
trying to figure out the best ways to do a bunch of things:
- Is there a way to catch 100% of 2nd chance exceptions, so that I can call
FailFast? Is simply handling the UnhandledException on the AppDomain class
enough to guarantee this? I think it is, as we only have a single AppDomain.
- I would like to catch any unhandled exceptions on background threads,
which often seem to be eaten by the CLR.
- I want to control the directory the dumps are written to - but I don't see
any way to do this. Suggestions?
- Ideally I need to email notification of these dumps to someone, so they
can transfer them to us (or have this automatically in some way). I looked
into the Windows Error Reporting stuff, but it seems too heavy duty. We have
few crashes, but each of them should be looked into. I'm debating a 2nd
Service that watches for new crashdumps, then transfers them. There has to
be a better way to do this...
- When the service is "hung" and manually terminated, I would like a
crashdump to be generated. We can do this today with an ADPlus script, but I
would really like to eliminate this.
Is there an MSDN article or a CLR Team Member blog that I missed that offers
some guidance around doing this?
software products.
For the past few years, we've been using ADPlus scripts (thank you
BugSlayer!) to setup and catch 2nd Chance Exceptions, generating .NET 1.1
dumps, and then using WinDbg and Son of Strike to track down the culprit
(usually System.DirectoryServices. Ugh.). The problem is that this is a
cumbersome process for clients to go through (many of whom are
non-technical), and generally relies on knowing in advance that an error is
going to happen soon.
Our products are now all migrated to .NET 2.0, which has the new method
"Environment.FailFast". The documentation on this little gem is quite
scarce, and I'm trying to determine the best practices for using it. I'm
trying to figure out the best ways to do a bunch of things:
- Is there a way to catch 100% of 2nd chance exceptions, so that I can call
FailFast? Is simply handling the UnhandledException on the AppDomain class
enough to guarantee this? I think it is, as we only have a single AppDomain.
- I would like to catch any unhandled exceptions on background threads,
which often seem to be eaten by the CLR.
- I want to control the directory the dumps are written to - but I don't see
any way to do this. Suggestions?
- Ideally I need to email notification of these dumps to someone, so they
can transfer them to us (or have this automatically in some way). I looked
into the Windows Error Reporting stuff, but it seems too heavy duty. We have
few crashes, but each of them should be looked into. I'm debating a 2nd
Service that watches for new crashdumps, then transfers them. There has to
be a better way to do this...
- When the service is "hung" and manually terminated, I would like a
crashdump to be generated. We can do this today with an ADPlus script, but I
would really like to eliminate this.
Is there an MSDN article or a CLR Team Member blog that I missed that offers
some guidance around doing this?