How-to-simply...

Show inner exception details on mouse hover when debugging C# application

  • 1 [System.Diagnostics.DebuggerDisplay("ToString(),ng")
    public class AppException() : ApplicationException
    ...
    public override ToString() => "{base.Message} {inner exception...}"
  • N When applied on a class, it tells the debugger to display object's content using ToString() method. Sometimes it is easier to spot exception details from the inner exception with custom exception override ToString => "{base.Message} {some inner exception details}" with mouse hover in debug mode than the default ex.Message in tools like Rider or Visual Studio.

References