Oct 21, 2010 at 8:28 PM
Edited Oct 21, 2010 at 8:34 PM
Turns out the logic bug was in my brain. :-) This reply is to help keep others from being confused too.
I dug into the code more and found that I misunderstood the purpose of the Demo project. I was trying to manually run ccs.exe after the build. I now realize that CciSharp.targets runs ccs.exe during the build.
Additionally I found it confusing that NotNullMutator inserted Microsoft.Contracts calls into the assembly and relied upon the contracts rewriter to create the final IL. In other words the Demo project’s Code Contracts settings determine the final
IL. The example you provided was for a Debug build. I was looking at a Release build in .NET Reflector with settings that do not run the rewriter. Running Demo.exe from a Release build throws an assertion.
Luckily down under the obj folder there are copies of the Demo executable from each stage of the processing. What the C# compiler generates is in Demo.csc.exe. What ccs.exe generates is in Demo.ccs.exe. What the Microsoft.Contracts rewriter generates is