The Wayback Machine - https://web.archive.org/web/20110509181328/http://social.msdn.microsoft.com:80/Forums/en-US/codecontracts/threads
DevLabs > DevLabs Forums > Code Contracts

Code Contracts

Discuss and provide feedback on Code Contracts.

Announcements

  • Welcome to Code Contracts for .NET

    Mike BarnettMicrosoft EmployeeFriday, February 20, 2009 2:28 AM
    We 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.

    The installer for these tools is available for either commercial or non-commercial use.

    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.

  • Release 1.4.40314.1 is now live!

    Mike BarnettMicrosoft EmployeeWednesday, March 16, 2011 6:11 PM

    A new release of Code Contracts is now live. It includes just a couple of quick bug fixes for things we found in the previous release. Check out the release notes for the details.

    If the download links have the usual caching problem, then you can try these:

     Download Standard Edition CodeContracts

     Download Premium Edition CodeContracts

    Please keep using the forum for communicating with us. We are trying to make the case for Code Contracts to be included in Visual Studio as an official product. Please send us your feedback as soon as possible, especially if you have any details about how exactly it has helped your development process.

    A new version of the Editor Extensions will be released this week. You may experience problems using the old (current) extensions at the same time as the new release. If you do see a problem with that, please let us know (and disable the editor extensions until the new release is ready). 

  • New Release for Visual Studio Editor Extensions for C# (v1.4.31130.0)

    Mike BarnettMicrosoft EmployeeThursday, December 09, 2010 10:24 PM

    There is a new release of the VS 2010 editor extensions on the VS Gallery. The extensions themselves haven't changed, but the underlying infrastructure has had many contract-related improvements so I hope it performs better. I will try to get around to fixing the performance problems that everyone has been noticing.

    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: a small graphic should pop up above the method definition showing any inherited contracts.
    • 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.

    Documentation is available at the MSR Code Contracts site.

12345678910 ... 6768>>(Showing 1 to 20 of 1345)
RepliesViews