Discuss and provide feedback on Code Contracts.
It has happened. New VS2010 and VS2012 Contract editor extensions are available on the gallery
It has taken a long time, we know, but we have finally released the contract editor extensions for VS2012 and an update to VS2010.
The new version is much more stable and less CPU consuming than previously and hopefully much more useful as a result.
If you haven't tried it yet, then please do and let us know what you think!
To review, the extensions should show you method contracts in the following situations:
- While you are typing a call to a method: the signature helper window should show you each overload's contract in the same window as the signature and exception information.
- Hovering over an existing method call: the quick info window should show you the method's contract in addition to its summary information.
- Method override and interface implementation definitions: hover over the method name in the signature to see the tooltip of the contracts inherited (or defined in the method).
- Metadata windows: if you "go to definition" for a type/method that is defined in an external assembly then the metadata window that VS creates should be augmented with method contracts.
Release 1.5.60502.11 is now live!Manuel FahndrichMicrosoft EmployeeSunday, March 17, 2013 11:17 PM
Welcome to Code Contracts for .NETWe are so happy that you are interested in Code Contracts! You are at exactly the right place for learning how to use contracts from any .NET language to:
- Specify method preconditions for expressing conditions that a caller must meet in order to call a method.
- Specify method postconditions for expressing conditions that the implementation of a method must meet before returning. Conditions can be specified for both normal termination as well as exceptional termination.
- Specify object invariants that describe the healthy states for an instance of a class.
We currently provide three tools for making use of contracts:
- A binary rewriter that operates as a post-build step to inject the contracts into the appropriate places for them to be evaluated at runtime.
- A static checker that operates as a post-build step to analyze your code without even executing it for potential contract violations.
- A documentation generator that adds information about the contracts to the XML documentation files for your project.
We welcome you to use the forum to ask questions about how to use contracts and the tools, to make suggestions for how we can improve, and --- if you really must --- to report bugs and problems.
You can also check out our home page at Microsoft Research.
External projects using Code Contracts?
We have added a section to our web site listing the external projects that we know about which are using Code Contracts. If you would like your project listed, please send us a link and we'll add it to the list. This would really help us in our efforts to get the project more fully supported by the product groups.
Filtering and SortingUse these options to narrow down the question and discussion list.
Code Contracts 1.5.60502.11 generates unexpected error CC1011: This/Me cannot be used in Requires of a constructorVBA Derks Wednesday, May 08, 2013 7:50 AM
- 2107KrampDotNet Friday, May 17, 2013 2:03 PM
- 257Josef Bláha Monday, May 20, 2013 12:17 PM
- 44495nazareno.it Saturday, May 08, 2010 6:45 AM
- 135563winSharp93 Tuesday, May 12, 2009 7:11 PM
- 1110Melor Friday, May 10, 2013 11:47 AM
- 7230Jesse Sweetland Tuesday, April 16, 2013 1:41 PM
- 279alan.bradbury.0710 Tuesday, May 14, 2013 8:24 PM
- 2111Dave Sexton Monday, May 06, 2013 9:39 PM
- 12256Jesse Sweetland Tuesday, April 16, 2013 6:54 PM
- 484Danny Tuppeny _ NM Wednesday, May 08, 2013 1:38 PM
- 43621Sebastian Good Friday, April 08, 2011 2:57 AM
CC warnings cause build to *fail* when using MSBuild, even if CodeContractsFailBuildOnWarnings=falseDanTup Thursday, April 25, 2013 9:56 AM
- 11200Jonnroc Monday, April 29, 2013 3:41 PM
- 298Haithem Boujerida Tuesday, May 07, 2013 5:09 PM
- 3238Flusskrebs Wednesday, April 17, 2013 3:28 PM
- 9146Danny Tuppeny _ NM Thursday, May 02, 2013 3:31 PM
- 077Dave Sexton Tuesday, May 07, 2013 4:17 PM
- 084Dave Sexton Tuesday, May 07, 2013 3:38 PM
- 1116Dave Sexton Friday, May 03, 2013 2:45 PM