Installing and Enabling Code Contracts
suggest changeSystem.Diagnostics.Contracts is included in the .NET Framework, but the rewriter and static checker are not. Install the Visual Studio extension.
Under Extensions and Updates, search for Code Contracts and install the Code Contracts Tools.
After the tools are installed, enable Code Contracts on the project. At a minimum, enable static checking (check after build). If you are implementing a library that other solutions will use, also consider runtime checking.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents