Difference Between Application Exception and System Exception

后端 未结 2 1005
刺人心
刺人心 2021-01-04 00:41

I want to know the difference Between System.ApplicationException and System.Exception.

Can anyone explain

2条回答
  •  情书的邮戳
    2021-01-04 01:29

    Originally they were intended to separate BCL defined and user defined Exceptions. ApplicationException was meant to be the base class for all user defined exceptions. The idea was it would give you a clean way to differintiate between framework exceptions and custom exceptions.

    Unfortunately this policy was not enforced from the start and as a result there are many contradictions to this rule in the BCL. The current recomendation is not to inherit from these exceptions.

    Here's a nice blog entry on the subject:

    • http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx

提交回复
热议问题