Code Contracts
Discuss and provide feedback on Code Contracts.
Ankündigungen
Release 1.2.21023.14 is now available!
Mike BarnettMSFTSamstag, 24. Oktober 2009 21:07A new release of Code Contracts is now live. And we almost made our once-a-month release schedule! This is mostly a release that fixes a lot of problems reported on the forum. Check out the release notes for the details.
Please keep using the forum to let us know how you're using Code Contracts and what problems you're running into. Of course, we'd be thrilled to hear of any success stories too.
And we'll be at PDC 2009! We'll be having a session along with Pex and also a demo booth. If you're going to PDC (and of course you should), please come by and see us.Welcome to Code Contracts for .NET
Mike BarnettMSFTFreitag, 20. Februar 2009 02:28We 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.
Filtern und SortierenMit dieser Optionen können Sie die Diskussionsliste eingrenzen.
- 2248

CodeContracts XML docs not getting generated
Manuel FahndrichMSFTDonnerstag, 5. November 2009 21:55 - 10488

Release 1.2.21023.14 is now available!
Mike BarnettMSFTSamstag, 24. Oktober 2009 21:10 - 13404

Get started using contracts!
Mike BarnettMSFTFreitag, 20. Februar 2009 02:37 - 03153

Frequently Asked Questions
Manuel FahndrichMSFTMittwoch, 25. Februar 2009 06:33 - 012

Why inferring methodensures doesn't work here?
Alexey R. vor 4 Stunden 54 Minuten - 4115

False Positive: CodeContracts: Suggested precondition: Contract.Requires(!string.IsNullOrEmpty(value));
Jonathan Allen Samstag, 21. November 2009 07:53 - 3185

ContractsRuntime recursion guard optimization
Alexey R. Sonntag, 15. November 2009 12:20 - 228

False positive on LinkedList.First
Jonathan Allen vor 21 Stunden 4 Minuten - 122

False Positive on read-only fields
Jonathan Allen vor 21 Stunden 12 Minuten - 020

Installer path issue
Kit vor 14 Stunden 33 Minuten - 132

Unclear Warning "CodeContracts: requires unproven"
Jonathan Allen vor 20 Stunden 51 Minuten - 234

Automatic Non Null Invariant for Initialized readonly Field in C#
Dave Sexton Dienstag, 24. November 2009 20:35 - 025

Inferring invariants
Alexey R. Dienstag, 24. November 2009 19:53 - 170

Possible bug?
Jahn Otto Næsgaard Andersen Montag, 23. November 2009 14:18 - 028

Is it fixed in latest release about 'Call to impure method in a pure region in method'
DaveChan Dienstag, 24. November 2009 12:45 - 150

Is the contract for stream.read incorrect?
John Melville Montag, 23. November 2009 05:14 - 020

BinaryFormatter Deserialize Missing Ensures Return Not Null
Dave Sexton Dienstag, 24. November 2009 11:03 - 027

Contract.ForAll Static Checking
Dave Sexton Dienstag, 24. November 2009 10:53 - 126

Suggested precondition for null check ignores existing precondition for String.IsNullOrWhiteSpace
Dave Sexton Dienstag, 24. November 2009 10:21 - 1110

Missing Requires in indexer of ReadOnlyCollection<T>
Alexey R. Mittwoch, 18. November 2009 18:43

