title: Building with Code Contracts?
body: <p>I have the following method:</p>
  
  <pre><code>private void DoSomething(CoolClass coolClass)
  {
      if (coolClass == null)
      {
          throw new ArgumentNullException("coolClass");
      }
      coolClass.Name = "Pepe";
  }
  </code></pre>
  
  <p>With Code Contracts we can write it like this:</p>
  
  <pre><code>private void DoSomething(CoolClass coolClass)
  {
      Contract.Requires&lt;ArgumentNullException&gt;(coolClass != null, "IS NULLL!");
      coolClass.Name = "Pepe";
  }
  </code></pre>
  
  <p>The second method is shorter and simpler. The problem that I have is that when you build it, in runtime it does not throw the exception, it shows this:</p>
  
  <blockquote>
    <p>Description: An assembly (probably "CodeContractsTest") must be rewritten using the code contracts binary rewriter (CCRewrite) because it is calling Contract.Requires and the CONTRACTS_FULL symbol is defined. Remove any explicit definitions of the CONTRACTS_FULL symbol from your project and rebuild. CCRewrite can be downloaded from <a href="http://go.microsoft.com/fwlink/?LinkID=169180" rel="noreferrer">http://go.microsoft.com/fwlink/?LinkID=169180</a>. After the rewriter is installed, it can be enabled in Visual Studio from the project's Properties page on the Code Contracts pane. Ensure that "Perform Runtime Contract Checking" is enabled, which will define CONTRACTS_FULL.</p>
  </blockquote>
  
  <p>Unless with VS you download the CodeContracts for .net from <a href="http://visualstudiogallery.msdn.microsoft.com/1ec7db13-3363-46c9-851f-1ce455f66970" rel="noreferrer">here</a>.</p>
  
  <p>And then you check the "Runtime check" in the project, so that when you build it in runtime, the exception is thrown.</p>
  
  <p>Our app is build with Jenkins with PowerShell scripts. Is there any way to check in runtime and throw the exception, with a simple command or attribute, or something easy?</p>