In C#, are there any built-in exceptions I shouldn't use?

前端 未结 6 2801
[愿得一人]
[愿得一人] 2021-02-20 10:08

Are there any Exceptions defined in the .NET Framework that I shouldn\'t throw in my own code, or that it is bad practice to? Should I write my own?

6条回答
  •  不思量自难忘°
    2021-02-20 10:46

    The online Design Guidelines for Exceptions contains the principle advice (see specifically this page).

    The book "Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries, 2nd Edition" has more details and more discussion on this topic.

提交回复
热议问题