Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Contract : ccrewrite exited with code -1?

I'm new to code contracts. I downloaded the latest build of code contract project (1.4.40314.1) and started to implement it in my project. When i enabled 'Runtume Checking' through Code Contracts Tab in VS2010, i got this Error

Error 1 The command ""C:\Program Files (x86)\Microsoft\Contracts\Bin\ccrewrite" "@Application1ccrewrite.rsp"" exited with code -1.

everytime i build the project. Plz help.


Now it's a major problem for me. Every project using code contracts is showing same error in VS2010 Errors window and 'Application1ccrewrite.rsp' not found in output window, but it is there.


I tried out everything. I installed both versions (Pro, Std) but the problem persist. Plz help !


Screenshot

like image 967
Code0987 Avatar asked Apr 10 '11 07:04

Code0987


3 Answers

I had this problem as well. In my case the problem was that ccrewrite cannot work with files in a network folder but requires the project to be on your local hard disk.

like image 175
J Fabian Meier Avatar answered Nov 07 '22 17:11

J Fabian Meier


I had this problem. The Assembly name and Default namespace of the class library that causes the problem had the same name as an existing DLL in the destination folder. I had been refactoring my code and whilst the namespaces in the CS files had all be changed to namespace2 the default namespace in the properties file was still namespace1 When I corrected this the files all built successfully...

like image 22
Steve Saxton Avatar answered Nov 07 '22 17:11

Steve Saxton


Sometimes you can get this when your solution path is too long, especially with many projects.

Try moving to c:\temp and building it, it might fix it (although of course, this might not be a solution if you need it in the folder it currently is).

This bug I noticed in earlier CC versions and may now be fixed.

like image 1
Stephen Drew Avatar answered Nov 07 '22 18:11

Stephen Drew