WpfExceptionMessageBox 1.0.1

dotnet add package WpfExceptionMessageBox --version 1.0.1                
NuGet\Install-Package WpfExceptionMessageBox -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WpfExceptionMessageBox" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WpfExceptionMessageBox --version 1.0.1                
#r "nuget: WpfExceptionMessageBox, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install WpfExceptionMessageBox as a Cake Addin
#addin nuget:?package=WpfExceptionMessageBox&version=1.0.1

// Install WpfExceptionMessageBox as a Cake Tool
#tool nuget:?package=WpfExceptionMessageBox&version=1.0.1                

WPF Exception MessageBox

The WPF Exception MessageBox is a custom gui MessageBox specifically designed to display the details of an Exception object to the user for debugging purposes that targets the Microsoft Windows Presentation Framework (WPF).

This project is currently available for Core 3.1 and NET 5. Support for NET 6 will come out soon.

To use the WPF Exception MessageBox, simply put this in a catch statement:

//...
using WpfExceptionMessageBox;
//...
    try
    {
        // Do something wrong here
    }
    catch (Exception e)
    {
        // TO quickly display the exception, just pass
        // the exception to the static show method.
        _ = ExceptionMessageBox.Show(e)
    }

The ExceptionMessageBox.Show static method has multiple overloads that allows customization of the message box title and severity icon that is displayed in the box.

Default Display:

Default Display

Display with Informational severity:

Display with Informational severity

Display with Warning severity:

Display with Warning severity

Additional Exception Details Window:

Additional Exception Details Window

You can also provide additional help to the user by adding a link to additional help details to the thrown exception:

            try
            {
                throw new OutOfMemoryException();
            }
            catch (Exception e)
            {
                e.HelpLink = "https://dotnet.microsoft.com/";
                _ = ExceptionMessageBox.Show(owner, e, ExceptionSeverity.Warning);
            }

Additional Exception Details Window with Help button:

Additional Exception Details Window with Help button

The exception details can be copied from the message box so that they can be easily saved or emailed to someone else for additional analysis.

This is how the exception details will look when copied from the exception box. This example is for a thrown AggregateException object, which the message box will capture all inner exception details as well as the parent exception:

Exception Type: AggregateException
=======================

Exception Message:
One or more errors occurred. (Invalid cast occurred, in theory) (Operation is not valid due to the current state of the object.)

Exception Stacktrace:
   at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.WaitAll(Task[] tasks)
   at EmbWpfExample.MainWindowViewModel.Aggregated(Window owner) in ...\exceptionmessagebox\Samples\EmbWpfExample\MainWindowViewModel.cs:line 80

Target Site:
ThrowAggregateException

Exception Source:
System.Private.CoreLib

***********************

Exception Type: InvalidCastException
=======================

Exception Message:
Invalid cast occurred, in theory

Exception Stacktrace:
   at EmbWpfExample.MainWindowViewModel.<>c.<<Aggregated>b__19_0>d.MoveNext() in ...\exceptionmessagebox\Samples\EmbWpfExample\MainWindowViewModel.cs:line 73

Target Site:
MoveNext

Exception Source:
EmbWpfExample


Exception Type: InvalidOperationException
=======================

Exception Message:
Operation is not valid due to the current state of the object.

Exception Stacktrace:
   at EmbWpfExample.MainWindowViewModel.<>c.<<Aggregated>b__19_1>d.MoveNext() in ...\exceptionmessagebox\Samples\EmbWpfExample\MainWindowViewModel.cs:line 78

Target Site:
MoveNext

Exception Source:
EmbWpfExample
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net5.0-windows7.0 is compatible.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net6.0-windows7.0 is compatible.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
.NET Framework net472 is compatible.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • net5.0-windows7.0

    • No dependencies.
  • net6.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 751 1/3/2022
1.0.0 279 11/19/2021

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.0.1] - TBD

### Added

- Support for frameworks net472, net48, and net6.0

## [1.0.0] - 2021-11-19

### Added

- Initial project setup.