RSS

Must use the rewriter when using Contract.Requires

09 May

Recently I began using the new DevLabs: Code Contracts. This is indeed a nice feature to C#. But you may get the error when you call a method that has some contract precondition saying the following:

Description: Must use the rewriter when using Contract.Requires


This error is telling you that the option “Perform Runtime Checking Contract” is unchecked.
Please note that you have to turn on that option not in the code that calls the specific assembly, but the assembly that owns that code.

Assembly with CodeContracts

Option has to be checked

 

Calling Assembly

Option has not necessarily checked

Advertisements
 
Leave a comment

Posted by on May 9, 2011 in Code Contracts

 

Tags:

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: