4

My C# project developed in VS2015 used Code Contracts. This tool has gone stale since being open sourced by Microsoft and I don't plan to use it in VS2017. That said, when I attempt to run my project's unit tests in VS2017 it complains about the assembly needing to be rewritten using CCRewrite because it contains preconditions. When I create a new VS2017 project (as a test) with preconditions I do not get this error.

What do I need to do to get rid of the error message in my legacy project?

Mike Lowery
  • 2,630
  • 4
  • 34
  • 44

1 Answers1

3

I finally found another post stating that Contract.Requires<TException>(...) requires a rewriter whereas Contract.Requires(...) does not. After making this change in my project it is now executing without errors in VS2017.

Mike Lowery
  • 2,630
  • 4
  • 34
  • 44