.NET exception caught is unexpectedly null

后端 未结 6 1654
囚心锁ツ
囚心锁ツ 2021-02-05 01:16

See below for an explanation of what is going on

I have a really weird issue where the exception caught is null.

The code uses MEF and tries har

6条回答
  •  [愿得一人]
    2021-02-05 01:47

    You should check if at some point, the IocContainer catches an Exception ex throws ex.InnerException without checking if it is null.

    C# happily accepts throw null, and ends up in catch (Exception).

提交回复
热议问题