Does Visual Studio 2015 preview support code contracts? RRS feed

  • Question

  • Does Visual Studio 2015 preview support code contracts either officially or unofficially?
    Wednesday, November 19, 2014 5:39 PM

All replies

  • I made a blog post here about what I have discovered about making Code Contracts work with the 2015 preview. I can get part of the way there, however, the Roslyn compiler inserts metadata into the code. The Code Contracts tools have a switch statement for values 1 through 4, but throw an exception on the value 5, which is what the compiler inserts. I suspect if they just took out the exception for unknown values it would all work fine. Or alternately adding a case for the 5 value. Without patching the tools, I don't know how to make it work.

    Come on guys, this is important...make it work with 2015.

    Thursday, December 4, 2014 6:10 PM
  • This article show a possible way to overcome roslyn - code contracts discrepancy and the reason behind it.
    Wednesday, December 10, 2014 3:01 PM