1 / 7

.NET Debugging for the Production Environment

Learn how to debug managed exceptions in a production environment, including collecting relevant data, using common debugger commands, and understanding first and second chance exceptions.

seabrooks
Download Presentation

.NET Debugging for the Production Environment

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. .NET Debugging for the Production Environment Part 6: Debugging a Managed Exception Brad Linscott Premier Field Engineering

  2. Agenda • Managed exceptions • Data to collect in production environment • Common debugger commands for managed exceptions • Demo

  3. Managed Exceptions • 1st chance (non-fatal) and 2nd chance (fatal/crash) • Like everything else in .NET, an exception is an object. • Too many too quickly will degrade performance.

  4. Data to Collect for Exceptions • Perfmon (.NET CLR Exceptions/#ExceptionsThrown/sec) exposes frequency of exceptions • Dump file when exception is thrown • DebugDiag/ADPlus can be configured to automate the procedure

  5. Common Debugger Commands for High CPU Hangs • !PrintException (addr), if alive on the current thread • !DumpObject (addr); Look for InnerException • To find the offending function(s), use stack & thread commands • Any variant of ‘k’ (kb, kn, kp, k, etc.) for native stacks • !psscorX.clrstack for managed stack (X=2, 4) • Other thread/stack commands • Sometimes we need help finding the executing line of code in the offending function • u;!u

  6. Demo: Debugging a Managed Exception

  7. Feedback? • Send us your feedback! • What other topics do you want covered?

More Related