Exception Merger

From RedGateWiki

Jump to: navigation, search

Contents

Documenting unhandled exceptions using Exception Hunter

Visual Studio 2005 supports automatic documentation of .NET assemblies at build-time by producing an XML file detailing all of the comments entered into the code. Typically, these are the comments that you enter for a namespace, class, or method using the /// comment format. The XML documentation file can later be converted to HTML or compiled help (CHM) format using Microsoft’s new Sandcastle utility, available as a free download from Microsoft’s website.

The documentation can include data about the types of exceptions that are thrown by a method, but the steps for adding this information are completely manual. Exception Hunter can produce a list of unhandled exceptions that can occur in a method simply by analyzing an assembly, so it would be useful to merge the output from Exception Hunter into the documentation produced by Visual Studio.

Exception Merger was created to perform automatic documentation of unhandled exceptions by calling Exception Hunter to produce a report in XML format and inserting the exceptions found into the Visual Studio documentation for every public method in your assembly.

Image:ExceptionMerger.Png

Exception Merger requirements:

 - .NET Framework 2.0
 - Exception Hunter from Red Gate Software
 - Windows XP, Windows Server 2003
 - Sandcastle (optional) for creating help documents

Download

Download Exception Merger

Creating end-user documentation about unhandled exceptions

Exception Merger can also be used from the command prompt, making it possible to integrate with other documentation tools, such as Microsoft’s Sandcastle documentation builder, which can produce help files based on Visual Studio’s built-in documentation capabilities. To automatically add unhandled exceptions to the documentation produced by Sandcastle, first merge the Visual Studio documentation with Exception Hunter’s output by using MergeExceptions.exe, then call Sandcastle to build a help file. The included sample, build_sandcastle.bat, shows how Exception Hunter, MergeExceptions.exe, and Sandcastle are used together to produce documentation for an assembly that can be shared with developers and third parties.

Image:ExceptionCHMExample.Png

If Sandcastle and Microsoft HTML Help Studio are installed, the example batch script will produce several subfolders containing HTML Help Studio project files, HTML documentation, and a Compiled HTML Help (CHM) file. Using the batch file example:

Build_sandcastle vs2005 Example

Will produce a help file documenting the example assembly.

Discussion

Any comments about the Exception Merger or Exception Hunter are welcome at the Exception Hunter Forum

Personal tools