ccrewrite

Why is ccrewrite.exe not doing anything from the command line?

I've got Code Contracts working fine from inside Visual Studio 2010, but I can't get ccrewrite.exe to do anything useful from the command line. Here's a sample app: using System.Diagnostics.Contracts; public class Dummy { public static void Main(string[] args) { Contract.Requires(args.Length > 0); } } I then compi...

CodeContracts: ccrewrite fails with Object reference not set to an instance of an object

The below code makes ccrewrite blow up! Ideas? BTW, If you comment out the ActualClass, ccrewrite succeeds... [ContractClass(typeof(TestContracts))] interface ITestInterface { bool IsStarted { get; set; } void Begin(); } class ActualClass : ITestInterface { public bool IsStarted { get; s...

Using Code Contracts in library code built with MSBuild

I've started using Code Contracts in all new code I'm writing, such as in a framework library I'm building to help bootstrap IoC, O/RM, etc., in an ASP.NET MVC application. I've written a simple build script for this framework library that looks like the following: @echo off echo. echo Cleaning build output (removing 'obj' and 'bin' fol...