0

I'm pretty sure I tried to use Code Contracts in C# code by just including a reference to System.Diagnostics.Contracts Namespace http://goo.gl/wZIg54 .

But Code Contracts for .NET page suggests I need to download MSI package. Why is it so? Are Code Contracts built-in into .NET / C# or not?

vkelman
  • 1,501
  • 1
  • 15
  • 25
  • OP is just asking for a url to download a library – bizzehdee Sep 17 '14 at 21:35
  • It has more bells and whistles. Like static checking, document generation, code snippet support. You'll have to RTFM, chapter 6 and up. – Hans Passant Sep 17 '14 at 21:42
  • But what this library provides exactly? If I'm not making things out, I used System.Diagnostics.Contracts without downloading a library, because this assembly is here by default. – vkelman Sep 17 '14 at 21:43
  • @vkelman: The classes are included in the `System.Diagnostics.Contracts` namespace, but the tools that utilize them are a separate download. Without the tools the static methods do nothing. – Jesse Good Sep 17 '14 at 22:06

1 Answers1

3

@vkelman the calls required to specify contracts are part of the basic framework (for example, Contract.Requires). Visual Studio doesn't do anything with these, however, unless you've installed the tools that come in the MSI package.

phoog
  • 42,068
  • 6
  • 79
  • 117