.NET exception caught is unexpectedly null

后端 未结 6 1659
囚心锁ツ
囚心锁ツ 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

    I ran into the same problem. The exception was null when viewed in the debugger even though the correct type of exception - UpdateException - was being caught. I could view the exception by opening the Exception Assistant.

    As soon as I turned off "Perform Runtime Contract Checking" caught exceptions where no longer null. I have been actively using code contracts for going on a year now and had not seen this problem before I starting working with EF 4.1 in this particular project recently - but I do not know if EF was a controlling variable in regards to caught exceptions being null.

提交回复
热议问题