Practical .NET

Quick Tip: Read the Inner Exception!

That's often where the real problem is.

Another short tip, but, potentially the best one you'll ever get (at least, from me).

When you're debugging and you get an exception, always, always, always click on the View Details link to open the View Details dialog.

If the message in the dialog isn't expanded, expand it, then scan down to the Inner Exception entry. Sometimes it's null, but more often than not, that's where the original problem (and the one you have to fix) is described.

In fact, it's often worthwhile to expand the Inner Exception and read its Inner Exception property.

More Practical .NET Debugging Tips from Peter Vogel:

About the Author

Peter Vogel is a system architect and principal in PH&V Information Services. PH&V provides full-stack consulting from UX design through object modeling to database design. Peter tweets about his VSM columns with the hashtag #vogelarticles. His blog posts on user experience design can be found at http://blog.learningtree.com/tag/ui/.

comments powered by Disqus

Featured

  • Creating Business Applications Using Blazor

    Expert Blazor programmer Michael Washington' will present an upcoming developer education session on building high-performance business applications using Blazor, focusing on core concepts, integration with .NET, and best practices for development.

  • GitHub Celebrates Microsoft's 50th by 'Vibe Coding with Copilot'

    GitHub chose Microsoft's 50th anniversary to highlight a bevy of Copilot enhancements that further the practice of "vibe coding," where AI does all the drudgery according to human supervision.

  • AI Coding Assistants Encroach on Copilot's Special GitHub Relationship

    Microsoft had a great thing going when it had GitHub Copilot all to itself in Visual Studio and Visual Studio Code thanks to its ownership of GitHub, but that's eroding.

  • VS Code v1.99 Is All About Copilot Chat AI, Including Agent Mode

    Agent Mode provides an autonomous editing experience where Copilot plans and executes tasks to fulfill requests. It determines relevant files, applies code changes, suggests terminal commands, and iterates to resolve issues, all while keeping users in control to review and confirm actions.

  • Windows Community Toolkit v8.2 Adds Native AOT Support

    Microsoft shipped Windows Community Toolkit v8.2, an incremental update to the open-source collection of helper functions and other resources designed to simplify the development of Windows applications. The main new feature is support for native ahead-of-time (AOT) compilation.

Subscribe on YouTube