List of exceptions that CAN'T be caught in .NET

前端 未结 8 1336
忘掉有多难
忘掉有多难 2020-11-30 09:16

What is the list of exceptions that CAN\'T be caught in .NET? Or where can I find such a list?

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 09:28

    Any exception that you can't reference by type because of accessibility can't be explicitly caught, but can be caught using the base Exception type.

    For example, a ContractException in the code contracts framework is purposely made internal to its assembly so that you can't try to catch it explicitly.

提交回复
热议问题