Questions tagged [ccrewrite]

10 questions
27
votes
1 answer

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…
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
5
votes
1 answer

Code Contracts Rewrite Failed - libpaths order

My Solution/Project builds fine with code contracts turned off for this particular project. When I turn on Perform Runtime Contract Checking on my project, the build fails. The CC rewriter starts to kick up hundreds of messages along the lines of:…
jasper
  • 3,424
  • 1
  • 25
  • 46
3
votes
2 answers

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…
Asbjørn Ulsberg
  • 8,721
  • 3
  • 45
  • 61
3
votes
1 answer

How does "Contract.Requires" behave without ccrewrite? Does this differ from "Requires"?

When not using ccrewrite (say the project is built by another developer without CC installed), Is Contract.Requires(cond) silently stripped or does it still result in behavior equivalent to if (!cond) { throw new T() }? (I don't care if it's…
user2864740
  • 60,010
  • 15
  • 145
  • 220
2
votes
2 answers

Why has my WebAPI REST method broken over the weekend?

I have some simple WebAPI Models/Repositories/Controllers. I was able to test these Friday in a browser using: http://localhost:48614/api/departments/ ...which would return the test departments data in the browser page. Now, though, the same…
1
vote
1 answer

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(); …
Vyas Bharghava
  • 6,372
  • 9
  • 39
  • 59
0
votes
1 answer

Building coded ui test project fails when "Perform runtime contract checking" is set to "full"

I have a simple Test project where a CodedUITestMethod is created. The test method simply clicks the Windows Start button in the taskbar. The method is generated by the Coded UI Test Builder tool from Visual Studio 2010 Ultimate. Then, I go to…
Jacob
  • 127
  • 1
  • 2
  • 9
0
votes
2 answers

Using Code Contracts, why does ccrewrite require access to every runtime dependency?

I'm trying to use Code Contracts and I'm running into a problem that is blocking me. With Contract Reference Assembly set to Build, ccrewrite is erroring while trying to access assemblies that are referenced indirectly by assemblies that are…
Jay
  • 383
  • 2
  • 16
0
votes
0 answers

Code Contract : ccrewrite exited with code -1073741571

I use code contracts and local build with VS 2013 is fine, but on build server i get the next error: MSB3073: C:\Program Files (x86)\Microsoft\Contracts\MsBuild\v14.0\Microsoft.CodeContracts.targets(642,5): The command ""C:\Program Files…
gsv
  • 277
  • 1
  • 9
0
votes
1 answer

CONTRACT_FULL is defined, but the definition is nowhere to be found

I am currently looking into the code contracts of the .NET framework. What I'd like to do is to use those contracts, while avoiding that my coworkers are forced to install the required extensions for Visual Studio and continue there work as is. Aber…
Nitram
  • 6,486
  • 2
  • 21
  • 32