I work for SRA International (www.sra.com) as a Technical Lead managing a team of .Net developers. In my role, I am deeply interested in topics that will enhance our team’s software development process. When I recently had the opportunity to review ‘Advanced .Net Debugging ‘by Mario Hewardt (Addison Wesley, 2010), I jumped at the chance. I was able to review this book, through my membership and participation in the Gwinnett Georgia, Microsoft User Group (www.ggmug.com). Despite the book’s title, there is something for all levels of .Net developers. Junior developers can get a useful inventory of the various tools that are available for debugging to complement the debugger found in Microsoft Visual Studio. Developers of all experience levels can benefit from the numerous tips and tricks described in the book. Senior developers can gain valuable insight into how to approach difficult bugs caused by interoperability, out of memory exceptions, and thread synchronization problems. The source code for the book is available for download at http://www.advanceddotnetdebugging.com/default.htm. The purchase of the book also allows the user access to a free online edition through Safari books for 45 days.
The author is a Senior Development Lead with Microsoft and has previously written “Advanced Windows Debugging”. He started working with the Windows team on Windows 98 and is currently working on online management services. His past experience with Windows is evident as he describes how Windows loads native images (for example notepad.exe) as well as managed assemblies. The author gets deep into the nitty gritty details quickly. By the end of the first section, the reader is able to set a breakpoint using Windbg (Win Debug) in the Windows notepad application.
The book assumes a working knowledge of C#, but an in depth knowledge of the CLR (Common Language Runtime) is not required. The book focuses on 32 bit development and the .Net Framework version 2.0. Features in the latest release of the .Net Framework 4.0 are touched on briefly, but the book was published prior to the release of .Net Framework 4.0 to manufacturing. The samples are in C#; this is something to keep this in mind if you are a VB .Net developer. There also are newer versions of the debugging tools since the time the book was published, which are free to download from Microsoft and other vendors. The book clearly states where users can find the tools referenced in the book.
The book is divided into three sections:
Part 1 contains an Overview of the book including chapters on the tools, CLR Fundamentals, and Basic Debugging tasks. To get a good working knowledge of .Net debugging, readers could focus on these chapters and come away with several nuggets of useful information.
Part 2 focuses on Applied Debugging. There are chapters on the Assembly Loader, Managed Heap and Garbage Collection, thread synchronization, and COM interoperability. Depending on what areas a developer may be interested in the reader may read these in any order, and might only be interested in one or more specific chapter.
Part 3 contains advanced topics. There are chapters on Postmortem debugging, Power Tools, and the CLR 4.0. At the time of the books release, only Beta 1 of .Net 4.0 was available, so there are possibly modifications to some of the debugging features that were included in the .Net 4.0 RTM release.
Overall, I would recommend the book to all .Net developers. New developers may find it somewhat daunting at first, but after working through the code samples, there is some information every developer can use. The focus on the underlying .Net framework internals helps developers understand concepts like memory management, garbage collection, and thread synchronization, regardless of whether the developer is interested in debugging or not. The discussion of the various available debugging tools alone is worth reading.
The only significant suggestion I have is that the book be updated to include more information on .Net 4.0 tools and functions to make it more up to date. The author also seems to assume some familiarity with a lot of the debugging tools, so plan on spending some time getting acquainted with them. There are not a lot of books written on this topic, so serious .Net developers should consider adding this book to their library.