Setup Problems

Code Contract configuration, works in 1.38.19b but not in 1.39.15b

Started by SolaAesir on 8,759 views

I'm using nCrunch with nUnit and code contracts. With no changes to the code I can run with 1.38 and the tests all run without issues (with both passing and failing tests), under 1.39 I get a message "Must use CCRewriter..." similar to this post. The nCrunch build is *much* faster under 1.39 than under 1.38 but 1.38 seems to have an issue where CCcheck.exe appears to hang for 30-60 seconds on each project before continuing when built under nCrunch (doesn't happen during the normal build) so it might just be that the issue causing that was fixed.

Another option is that
	<PropertyGroup Condition=" '$(NCrunch)' == '1' ">
		<CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure>
	</PropertyGroup>

in my project files is no longer taking effect.

Are there any changes to configuration in 1.39 I should be aware of? I can work just fine using 1.38 but the faster build times in 1.39 would be very nice to have.

Thanks.
Hi, thanks for posting!

1.39b saw the introduction of a new configuration setting to turn off code contracts for NCrunch. By default, code contracts are disabled. Since the 1.39b release, there's been quite a bit of feedback from other people that have a similar situation to you (i.e. their code requires the dynamic contracts but not the static contracts), so in the upcoming 1.40b release this option will be split in two - one for static checking, and one for dynamic checking.

1.40b should be out within a few days, until then I recommend adjusting the code contracts configuration option on your project-level NCrunch configuration so that you can continue to work with 1.39b.


Cheers,

Remco
For anyone interested, 1.40b has just been released with the above mentioned configuration changes, so hopefully this should no longer be an issue for the latest version of NCrunch.
1.40b did indeed fix the issue. Thank you.

Post a reply

Log in to reply.