Search code examples
build-processvisual-studio-2013code-contractsasp.net-web-api2

Why doesn't ccrewrite get called when I publish my project(s)?


I finally have ccrewrite working, and my unit tests are passing, but when I publish a web project, it keeps blowing up as if it hadn't been rewritten. After checking with JustDecompile, the code hasn't been rewritten:

 Contract.Requires<ArgumentNullException>(log != null, "Must provide a valid ILog to UmbracoServiceProvider");
 Contract.Requires<ArgumentNullException>(contentService != null, "Must provide a valid IContentService to UmbracoServiceProvider");
 Contract.Requires<ArgumentNullException>(examineManager != null, "Must provide a valid ExamineManager to UmbracoServiceProvider");

The above should be __ContractsRuntime... if it had been rewritten.

Suggestions?


Solution

  • When publishing, it was building the 'Release' configuration, which has it's own set of code-contract settings which I hadn't set up yet.