Debugging Applications for Microsoft .NET and Microsoft Windows



Debugging Applications for Microsoft .NET and Microsoft Windows


By Don Kiely


Bugs are the bane of the software industry. Although .NET s CLR has some wonderful built-in features that make applications more reliable and resilient to the imperfections we usually inadvertently build into them, we can still write buggy code. So much of a developer s time in any reasonably complex software project is spent tracking down the little suckers, either in code written just this morning or regrettably and to the detriment of our prospects for continued employment in an app that choked after being deployed to 1,000 desktops.


Debugging is one of those skills that is rarely taught in any kind of formal or informal software development training. It seems the underlying idea is if you re skilled enough, bugs won t slip into your software. This might be true for the handful of super-programmers that walk unseen among us. But even for such software gods, every so often they must debug someone else s code. So debugging is a skill necessary to a developer s success, yet it is largely self-taught, driven by random bugs and performed through home-grown tricks.


That s why I was thrilled that John Robbins finally finished the updated edition of his book Debugging Applications that has been long out of print. The new edition Debugging Applications for Microsoft .NET and Microsoft Windows (Microsoft Press) already has become one book I wouldn t consider doing Windows development without. This book helps you find and squash bugs faster using all the tools in .NET and Windows, gives you many tools the author has developed for analyzing applications, and gains for you a deep and broad understanding of bugs and how to avoid them for robust code all this while making you far sexier to existing or potential employers.


If you re expecting a simple rehash of how to use the debugger in VS .NET to step through your code, think again. Instead, the book delves deep into the guts of applications and Windows to figure out exactly what is going on. There are even incredibly clever techniques to using the VS .NET debugger that I had no idea existed and are not documented.


The book starts with part 1, The Gestalt of Debugging, which discusses the whole debugging experience with lots of practical advice about how to approach the task. By the end of part 2, Power Debugging, I was flabbergasted by the number of existing tools sitting on my development machine already and Robbins techniques that help zero in on software problems. This section covers Windows, .NET, and native code debugging, and Robbins provides plenty of nice tools and utilities to augment those from Microsoft. The remaining two parts of the book are Power Tools and Techniques for .NET, and Native Code.


One of the book s many gems is chapter 10, Managed Exception Monitoring. With a couple of years of building applications under my belt, I thought I had a pretty good handle on exceptions in .NET not even close! There are lots of exceptions that fire and are hidden by other code both .NET Framework code and your custom code that hurt performance and diminish your code s reliability. In this chapter, Robbins covers the Profiling API provided with the .NET Framework SDK. You might not know about this API because it isn t documented in MSDN Help. Instead, you find the Word file on your drive (Profiling.doc), which has all the information. The API does way more than profiling, and Robbins uses it to develop an ExceptionMon utility that makes monitoring exceptions a snap far better than setting VS .NET to break on every exception raised.


Much of the code for the book s utilities is written in C++ and included on the CD-ROM. But whether you code in C++, C#, or VB .NET, the book has plenty of information and tools to help you.


Be forewarned, however, that this book isn t for beginning coders, and not every section will be of interest to everyone. But the knowledge is crucial for anyone developing software that becomes increasingly complex all the time. I don t often gush like this about books certainly not software books but this one will make a difference.



Debugging Applications for Microsoft .NET and Microsoft Windows

By John Robbins

Microsoft Press

ISBN: 0-7356-1536-5


Don Kiely is senior technology consultant for Information Insights, a business and technology consultancy in Fairbanks, Alaska. E-mail him at mailto:[email protected].




Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.