This project has moved. For the latest updates, please go here.

Creating and Sending an Exception Report



Copy information from all visible tabs to the clipboard as a Formatted Exception Report] (see below). The user can then paste & use the textual information/report at their own convenience.


Save information from all visible tabs as a Formatted Exception Report to file. The user will be prompted to select the location and name of the text file to save.


Sends a Formatted Exception Report (see below) to an email address using one of 2 methods - determined by configuration
  • SMTP: an e-mail is sent directly to the e-mail address configured Note: the application's configuration must be set with a valid SMTP Server, to and from e-mail addresses, and, where necessary, SMTP authentication username and password.
  • Simple MAPI: the user's email client will be launched and automatically populated with a Formatted Exception Report. The subject and recipient (derived from configuration) are used to populate the relevant fields. By using MAPI, the user is able to modify the message and addresses as they normally would when using their email client. Note: For Simple MAPI to work, the user must have a suitable mail client installed (eg Outlook, Windows Mail).

Formatted Exception Report

An exception report includes various information that a developer should find useful in diagnosing a problem - in addition to any custom message the user has provided & the name of the Application which is configured. The tabs that are configured to be shown/hidden determine what categories of information are included. For example, hiding the AssemblyInfo via Config.ShowAssembliesTab = false will cause Assembly information to not be included in the formatted report.

The type of information within the categories is not configurable (ie within System Information is Memory/OS/Language/CurrentTimeZone etc) but hopefully generically useful, such that even if there is more than required, it can simply be ignored. We specifically try not to include too much.

An example of The Exception Report (ie formatted/line delimited) is shown below:

 	[General Info]
 	Application: ExceptionReporter Demo App
 	Region:      English (Australia)
 	Machine:     MACHINENAME
 	User:        JohnGruber
 	Date: 11/07/2010
 	Time: 12:40 AM
 	User Explanation:
 	JohnGruber said "I just pressed Connect and this happened"
 	[Exception Info 1]
 	Top-level Exception
 	Type:        System.IO.IOException
 	Message:     Unable to establish a connection with the Foo bank account service. The error number is #FFF474678.
 	Source:      WinFormsDemoApp
 	Stack Trace: at WinFormsDemoApp.DemoAppView.AndAnotherOne() in Z:\MyProjects\ExceptionReporter\src\WinFormsDemoApp\DemoAppView.cs:line 110
 	   at WinFormsDemoApp.DemoAppView.CallAnotherMethod() in Z:\MyProjects\ExceptionReporter\src\WinFormsDemoApp\DemoAppView.cs:line 101
 	   at WinFormsDemoApp.DemoAppView.SomeMethod() in Z:\MyProjects\ExceptionReporter\src\WinFormsDemoApp\DemoAppView.cs:line 96
 	   at WinFormsDemoApp.DemoAppView.ShowExceptionReporter(Boolean useConfig) in Z:\MyProjects\ExceptionReporter\src\WinFormsDemoApp\DemoAppView.cs:line 81
 	Inner Exception 1
 	Type:        System.Exception
 	Message:     This is an Inner Exception message - with a message that is not too small but perhaps it should be smaller
 	[Assembly Info]
 	mscorlib, Version=
 	System.Windows.Forms, Version=
 	System, Version=
 	ExceptionReporter.WinForms, Version=
 	System.Drawing, Version=
 	[System Info]
 	Operating System
 	-Microsoft Windows 7 Enterprise
 	--CodeSet = 1252
 	--CSDVersion =
 	--CurrentTimeZone = 600
 	--FreePhysicalMemory = 1947848
 	--OSArchitecture = 32-bit
 	--OSLanguage = 1033
 	--ServicePackMajorVersion = 0
 	--ServicePackMinorVersion = 0
 	--Version = 6.1.7600
 	--Manufacturer = Gigabyte Technology Co., Ltd.
 	--Model = P35-DS3L
 	--TotalPhysicalMemory = 3756515328
 	--UserName = MachineName\GruberMachine

Last edited Jul 10, 2013 at 7:51 AM by PandaWood, version 3