I just got 'bit' by this - I can understand skipping the static contract checking, but I don't understand not supporting the runtime checking (especially when my project has CONTRACTS_FULL defined :). As it stands, NCrunch couldn't run my tests, just throwing up the same type of failure dialog from the contract checking when the assembly wasn't built with runtime contract checking turned on.
Hopefully the intent was just to build faster by skipping the static checking (which is indeed time consuming). I don't see any gain to disabling the runtime checking, since either the project doesn't use it (so it's no overhead) or it does (in which case, disabling it breaks it :)
The particular project settings I'm referring to:
- CodeContractsEnableRuntimeChecking = True (I want the runtime checking)
- CodeContractsRunCodeAnalysis = False (I don't want the static checking - you can keep disabling that for the NCrunch build, that makes sense)
Thankfully I ran across this thread, but especially as an existing NCrunch user, it was painful to have it start failing in a non-obvious way like this. :)
If you feel disabling the runtime is still advantageous, can the static checking and runtime checking be split into 2 different flags, with the runtime one either defaulting to 'true' or at least defaulting to 'true' if the project has CodeContractsEnableRuntimeChecking = True? :)
Thanks!