Wednesday, July 2, 2008

What'is difference between System exceptions and Application exceptions?

From the System.SystemException documentation:

This class is provided as a means to differentiate between exceptions defined by the system versus exceptions defined by applications.

So, consider it the opposite of ApplicationException. All Exceptions that are defined by the .NET Framework inherit from SystemException. All Exceptions that are defined by code that you write should derive from ApplicationException. Exception is the root class of ALL exceptions.