System.Exception vs System.SystemException
What is the difference be开发者_C百科tween System.Exception vs System.SystemException
A SystemException is usually reserved for the .NET runtime/framework to use, and not your application code. Basically, don't derive from SystemException when creating your own custom Exception class.
If you are creating your own Exception classes, you should either derive them from Exception or ApplicationException. ApplicationException was originally intended to be used for non-framework exceptions, but it has sort of fallen to the wayside. I believe the framework authors now recommend to derive your custom Exceptions from the base Exception class.
Have a look here.
In a nutshell, System.Exception
is defined by applications and System.SystemException
is defined by the system (.NET Framework).
Here, this might help: Difference Between Application Exception and System Exception
SystemException provided as a means to differentiate between exceptions defined by the system versus exceptions defined by applications.
精彩评论