开发者

System.Exception vs System.SystemException

开发者 https://www.devze.com 2022-12-19 04:17 出处:网络
What is the difference be开发者_C百科tween System.Exception vs System.SystemExceptionA SystemException is usually reserved for the .NET runtime/framework to use, and not your application code.Basicall

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消