.NET Framework Class Library
SystemException Class

Serves as the base class for system exceptions namespace.

Inheritance Hierarchy
SystemObject
   SystemException
    SystemSystemException
      More...

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)
Syntax
<[%$TOPIC/z3h75xk6_en-us_VS_110_2_0_0_0_0%]> _
<[%$TOPIC/z3h75xk6_en-us_VS_110_2_0_0_0_1%](True)> _
Public Class SystemException _
	Inherits [%$TOPIC/z3h75xk6_en-us_VS_110_2_0_0_0_2%]
[[%$TOPIC/z3h75xk6_en-us_VS_110_2_0_1_0_0%]]
[[%$TOPIC/z3h75xk6_en-us_VS_110_2_0_1_0_1%](true)]
public class SystemException : [%$TOPIC/z3h75xk6_en-us_VS_110_2_0_1_0_2%]
[[%$TOPIC/z3h75xk6_en-us_VS_110_2_0_2_0_0%]]
[[%$TOPIC/z3h75xk6_en-us_VS_110_2_0_2_0_1%](true)]
public ref class SystemException : public [%$TOPIC/z3h75xk6_en-us_VS_110_2_0_2_0_2%]
[<[%$TOPIC/z3h75xk6_en-us_VS_110_2_0_3_0_0%]>]
[<[%$TOPIC/z3h75xk6_en-us_VS_110_2_0_3_0_1%](true)>]
type SystemException =  
    class 
        inherit [%$TOPIC/z3h75xk6_en-us_VS_110_2_0_3_0_2%] 
    end
public class SystemException extends [%$TOPIC/z3h75xk6_en-us_VS_110_2_0_4_0_0%]

The SystemException type exposes the following members.

Constructors
  NameDescription
Public method Supported by the XNA Framework SystemExceptionInitializes a new instance of the SystemException class.
Public method Supported by the XNA Framework SystemException(String)Initializes a new instance of the SystemException class with a specified error message.
Protected method SystemException(SerializationInfo, StreamingContext)Initializes a new instance of the SystemException class with serialized data.
Public method Supported by the XNA Framework SystemException(String, Exception)Initializes a new instance of the SystemException class with a specified error message and a reference to the inner exception that is the cause of this exception.
Top
Properties
  NameDescription
Public property DataGets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property HelpLinkGets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property Supported by the XNA Framework HResultGets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from Exception.)
Public property Supported by the XNA Framework InnerExceptionGets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property Supported by the XNA Framework MessageGets a message that describes the current exception. (Inherited from Exception.)
Public property SourceGets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property Supported by the XNA Framework StackTraceGets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property TargetSiteGets the method that throws the current exception. (Inherited from Exception.)
Top
Methods
  NameDescription
Public method Supported by the XNA Framework Equals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Supported by the XNA Framework FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method Supported by the XNA Framework GetBaseExceptionWhen overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method Supported by the XNA Framework GetHashCodeServes as the default hash function. (Inherited from Object.)
Public method GetObjectDataWhen overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method Supported by the XNA Framework GetTypeGets the runtime type of the current instance. (Inherited from Exception.)

In XNA Framework 3.0, this member is inherited from Object GetType.
Protected method Supported by the XNA Framework MemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public method Supported by the XNA Framework ToStringCreates and returns a string representation of the current exception. (Inherited from Exception.)
Top
Events
  NameDescription
Protected event SerializeObjectStateOccurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (Inherited from Exception.)
Top
Remarks

This class is provided as a means to differentiate between system exceptions and application exceptions. It is the base class of such exceptions as ArgumentException, FormatException, and InvalidOperationException.

Important noteImportant

Because SystemException serves as the base class of a variety of exception types, your code should not throw a SystemException exception, nor should it attempt to handle a SystemException exception unless you intend to re-throw the original exception.

SystemException uses the HRESULT COR_E_SYSTEM, that has the value 0x80131501.

Version Information

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Inheritance Hierarchy
SystemObject
   SystemException
    SystemSystemException
       Microsoft.SqlServer.ServerInvalidUdtException
       SystemAccessViolationException
       System.ActivitiesValidationException
       SystemAppDomainUnloadedException
       SystemArgumentException
       SystemArithmeticException
       SystemArrayTypeMismatchException
       SystemBadImageFormatException
       SystemCannotUnloadAppDomainException
       System.Collections.GenericKeyNotFoundException
       System.ComponentModel.Design.SerializationCodeDomSerializerException
       System.ComponentModelLicenseException
       System.ComponentModelWarningException
       System.ConfigurationConfigurationException
       System.Configuration.InstallInstallException
       SystemContextMarshalException
       System.DataDataException
       System.DataDBConcurrencyException
       System.DataOperationAbortedException
       System.Data.SqlTypesSqlTypeException
       SystemDataMisalignedException
       System.Deployment.ApplicationDeploymentException
       System.DirectoryServices.AccountManagementPrincipalException
       System.Drawing.PrintingInvalidPrinterException
       System.EnterpriseServicesRegistrationException
       System.EnterpriseServicesServicedComponentException
       SystemExecutionEngineException
       SystemFormatException
       System.IdentityModelLimitExceededException
       System.IdentityModelSecurityMessageSerializationException
       System.IdentityModel.TokensSecurityTokenException
       SystemIndexOutOfRangeException
       SystemInsufficientExecutionStackException
       SystemInvalidCastException
       SystemInvalidOperationException
       SystemInvalidProgramException
       System.IOInternalBufferOverflowException
       System.IOInvalidDataException
       System.IOIOException
       System.ManagementManagementException
       SystemMemberAccessException
       SystemMulticastNotSupportedException
       SystemNotImplementedException
       SystemNotSupportedException
       SystemNullReferenceException
       SystemOperationCanceledException
       SystemOutOfMemoryException
       System.PrintingPrintSystemException
       SystemRankException
       System.ReflectionAmbiguousMatchException
       System.ReflectionReflectionTypeLoadException
       System.ResourcesMissingManifestResourceException
       System.ResourcesMissingSatelliteAssemblyException
       System.Runtime.InteropServicesExternalException
       System.Runtime.InteropServicesInvalidComObjectException
       System.Runtime.InteropServicesInvalidOleVariantTypeException
       System.Runtime.InteropServicesMarshalDirectiveException
       System.Runtime.InteropServicesSafeArrayRankMismatchException
       System.Runtime.InteropServicesSafeArrayTypeMismatchException
       System.Runtime.RemotingRemotingException
       System.Runtime.RemotingServerException
       System.Runtime.SerializationSerializationException
       System.Security.AuthenticationAuthenticationException
       System.Security.CryptographyCryptographicException
       System.SecurityHostProtectionException
       System.Security.PolicyPolicyException
       System.Security.PrincipalIdentityNotMappedException
       System.SecuritySecurityException
       System.SecurityVerificationException
       System.SecurityXmlSyntaxException
       System.ServiceModelCommunicationException
       System.ServiceModel.DispatcherInvalidBodyAccessException
       System.ServiceModel.DispatcherMultipleFilterMatchesException
       System.ServiceModelInvalidMessageContractException
       System.ServiceModelQuotaExceededException
       System.ServiceProcessTimeoutException
       SystemStackOverflowException
       System.ThreadingAbandonedMutexException
       System.ThreadingSemaphoreFullException
       System.ThreadingSynchronizationLockException
       System.ThreadingThreadAbortException
       System.ThreadingThreadInterruptedException
       System.ThreadingThreadStartException
       System.ThreadingThreadStateException
       SystemTimeoutException
       System.TransactionsTransactionException
       SystemTypeInitializationException
       SystemTypeLoadException
       SystemTypeUnloadedException
       SystemUnauthorizedAccessException
       SystemUriTemplateMatchException
       System.Web.CachingDatabaseNotEnabledForNotificationException
       System.Web.CachingTableNotEnabledForNotificationException
       System.Web.ManagementSqlExecutionException
       System.Web.Services.ProtocolsSoapException
       System.Windows.AutomationElementNotAvailableException
       System.Windows.DataValueUnavailableException
       System.Windows.MarkupXamlParseException
       System.Windows.Media.AnimationAnimationException
       System.Windows.MediaInvalidWmpVersionException
       System.Workflow.ActivitiesEventDeliveryFailedException
       System.Workflow.ActivitiesWorkflowAuthorizationException
       System.Workflow.Runtime.HostingPersistenceException
       System.Workflow.Runtime.TrackingTrackingProfileDeserializationException
       System.Xml.SchemaXmlSchemaException
       System.XmlXmlException
       System.Xml.XPathXPathException
       System.Xml.XslXsltException