Microsoft Silverlight will reach end of support after October 2021. Learn more.
When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
Assembly: mscorlib (in mscorlib.dll)
'Declaration Public Overridable Function GetBaseException As Exception
public virtual Exception GetBaseException()
A chain of exceptions consists of a set of exceptions such that each exception in the chain was thrown as a direct result of the exception referenced in its InnerException property. For a given chain, there can be exactly one exception that is the root cause of all other exceptions in the chain. This exception is called the base exception and its InnerException property always contains a null reference.
For all exceptions in a chain of exceptions, the GetBaseException method must return the same object (the base exception).
Use the GetBaseException method when you want to find the root cause of an exception but do not need information about exceptions that may have occurred between the current exception and the first exception.
Notes to Inheritors
The GetBaseException method is overridden in classes that require control over the exception content or format.
Supported in: 5, 4, 3
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
Supported in: Xbox 360, Windows Phone OS 7.0
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.