Get Inner Exception Message C# - If you want only the original exception then use exception.getbaseexception().tostring(). Web public exception innerexception {get;}: Web it will collect data from all inner exceptions. This innerexception property gets the exception instance that caused the current exception. Web you must pass the inner exception in as an argument when throwing another exception, to have the innerexception field set. Web static class extensions { public static string getaallmessages(this exception exp) { string message = string.empty; Gets a message that describes the current exception. Web if the innerexception property of the current exception is a null reference ( nothing in visual basic), this property returns the current exception.
Web it will collect data from all inner exceptions. Web public exception innerexception {get;}: Web if the innerexception property of the current exception is a null reference ( nothing in visual basic), this property returns the current exception. Web you must pass the inner exception in as an argument when throwing another exception, to have the innerexception field set. Gets a message that describes the current exception. This innerexception property gets the exception instance that caused the current exception. Web static class extensions { public static string getaallmessages(this exception exp) { string message = string.empty; If you want only the original exception then use exception.getbaseexception().tostring().