locked
Visual Studio 2015 exited with code 2 RRS feed

  • Question

  • After I open a project with Visual Studio 2015 I am unable to resolve the compile error below.  I have uninstalled and reinstalled Code Contracts for .NET a few times to no avail.  Everything works great in VS2013.  Any idea what exit code 2 means or what needs to be performed to resolve this error?

    Thanks,

    Error The command ""C:\Program Files (x86)\Microsoft\Contracts\Bin\ccrewrite.exe" "@XXX.Api.Servicesccrewrite.rsp"" exited with code 2. XXX.Api.Services

    Monday, July 27, 2015 7:09 PM

All replies

  • Make sure you are using the latest version (currently 1.9.10714.2).

    I ran into a case just now where I was getting an error that was not specific at all. To figure out what was causing the issue I had to

    1. remove folders one at a time in my project until the error stopped.
    2. After that point I knew which folder the code file was in and then started going through that folder but this time with the contract classes until I got to the offending class.
    3. At that point I had to comment out method bodies until I got to the one that caused the error.
    4. And then go through each Contract.XXX line item until you get to the one that is causing the problem.

    Keep in mind it could be multiple places that causes the problem but hopefully after you discover the first one you can recognize the others as well.

    In case your error happened to be caused by the same issue as the one I just found please check this github issue link. If it's not related it would be great if you could create a reproduction of the problem and post it on the GitHub project as an Issue.

    Good luck.


    Mark as answer or vote as helpful if you find it useful | Igor

    Wednesday, September 16, 2015 12:34 PM