This site uses cookies for analytics, personalized content and ads. By continuing to browse this site, you agree to this use. Learn more
Microsoft Logo
Gray Pipe
Developer Network Developer Network Developer
:CreateViewProfileText: Sign in
Subscriber portal
Get tools
  • Downloads
    • Visual Studio
    • SDKs
    • Trial software
      • Free downloads
      • Office resources
  • Programs
    • Subscriptions
      • Overview
      • Administrators
    • Students
      • Microsoft Imagine
      • Microsoft Student Partners
    • ISV
    • Startups
    • Events
  • Community
    • Magazine
    • Forums
    • Blogs
    • Channel 9
  • Documentation
    • APIs and reference
    • Dev centers
    • Samples
    • Retired content
search clear
We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second.
Ask a question
Quick access
  • Forums home
  • Browse forums users
  • FAQ
Announcement: 9

Code Contracts announcement

  • Link
    Forum is closed
    Sandra Aldana - MSFT Friday, February 8, 2019 1:42 AM

    This forum is now closed. Thank you all for your participation.

    Regards,

    MSDN Forums team

  • Link
    CodeContracts Sources are now available on GitHub!!!
    Francesco Logozzo Tuesday, January 6, 2015 9:15 PM

    We just released the CodeContracts tools as Open Source on

    https://github.com/CodeContractsDotNet/CodeContracts

    We accept contribution!!!

    The CodeContracts team

  • Link
    CodeContracts Sources are now available on GitHub!!!
    Francesco Logozzo Tuesday, January 6, 2015 9:15 PM

    We just released the CodeContracts tools as Open Source on

    https://github.com/CodeContractsDotNet/CodeContracts

    We accept contribution!!!

    The CodeContracts team

  • Link
    New version of the tools released!!!! (v1.7.11106.10)
    Francesco Logozzo Monday, September 8, 2014 5:34 PM

    Better inference of object invariants for the static checker!

    Some bug fixes!

    Get it here: http://visualstudiogallery.msdn.microsoft.com/1ec7db13-3363-46c9-851f-1ce455f66970

  • Link
    New version released!!!! (v1.7.10903.10)
    Francesco Logozzo Monday, September 8, 2014 5:33 PM

    New checks, improved performances for the static checker

    Get it here: http://visualstudiogallery.msdn.microsoft.com/1ec7db13-3363-46c9-851f-1ce455f66970

  • Link
    NEW: CodeContracts Blog
    Francesco Logozzo Friday, September 5, 2014 12:07 AM

    Dear CC users,

      we are glad to announce the birth of a new blog on CodeContracts, static analysis etc: http://blogs.msdn.com/b/francesco/

  • Link
    It has happened. New VS2010 and VS2012 Contract editor extensions are available on the gallery
    RiSE (Research in Software Engineering) Tuesday, March 19, 2013 9:25 PM

    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.

    For VS2012:  http://visualstudiogallery.msdn.microsoft.com/02de7066-b6ca-42b3-8b3c-2562c7fa024f

    For VS2010: http://visualstudiogallery.msdn.microsoft.com/85f0aa38-a8a8-4811-8b86-e7f0b8d8c71b

    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.

    Enjoy.


  • Link
    External projects using Code Contracts?
    Mike Barnett Thursday, March 22, 2012 5:09 PM

    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.

    Thanks!

    Mike

  • Link
    Welcome to Code Contracts for .NET
    Mike Barnett Friday, 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.

RRS feed

  • Remove From My Forums

Forums [ view all ]

Selected forums

Clear
Code Contracts
x
Filter : All threads
All threads
Answered
Unanswered
Proposed answers
General discussion

No replies
Helpful
Has code

All languages
Sort : Most recent post
  • Most recent post
  • Most recent thread
  • Total votes
  • Total replies
  • large check mark
    0 Votes

    Get Contact Global List from office 365 online

    Archived Forums
     > 
    Code Contracts
    Hello        i am working on the winform application , i am able to get the Global address list form the Out look if the outlook install on my system and i use ...
    Unanswered | 0 Replies | 629 Views | Created by Dinesh Semwal - Thursday, January 10, 2019 7:49 AM
  • large check mark
    0 Votes

    DEV C++ can not execute code (Windows 10)

    Archived Forums
     > 
    Code Contracts
    My Dev C++ suddenly started this weird issue (it worked fine until today). When I execute a code, it shows the follwing message in the window instead of ...
    Unanswered | 1 Replies | 1021 Views | Created by TheScienceGuy - Friday, October 19, 2018 8:31 AM | Last reply by 寶大 - Monday, December 17, 2018 2:56 AM
  • large check mark
    0 Votes

    windows 10 IOT DHCP server

    Archived Forums
     > 
    Code Contracts
    i'm writing application code for a windows 10 IOT device and I need to run a DHCP server. the application works like this, I have a control device that runs win 10 IOT. via a wireless device I need to ...
    Unanswered | 0 Replies | 764 Views | Created by kc6ymp - Thursday, November 29, 2018 4:30 PM
  • large check mark
    0 Votes

    Creating End Application. Need Information.

    Archived Forums
     > 
    Code Contracts
    I Have Visual Studio 2012 Professional Version: 11.0.61219.00  Update 5. Microsoft Net Framework: ...
    Unanswered | 0 Replies | 594 Views | Created by Clyve Roksingha - Friday, November 16, 2018 8:06 AM
  • large check mark
    0 Votes

    Failed to connect to any cache. Windows 10, Visual Studio 2013.

    Archived Forums
     > 
    Code Contracts
    Setting up a new Windows 10 workstation and cannot run code contracts. Getting a pop-up with "Your SQL Server installation is either corrupt or has been tampered with (Unknown package id). Please ...
    Discussion | 6 Replies | 621 Views | Created by christaylor192 - Tuesday, July 17, 2018 5:05 PM | Last reply by christaylor192 - Wednesday, July 18, 2018 10:23 PM
  • large check mark
    0 Votes

    This project is likely dead. Is there an alternative?

    Archived Forums
     > 
    Code Contracts
    I'm using VS2017 and C# 7.2. Is there something similar to Code Contracts out there? Something elegant to at least prevent null parameters at static and runtime.
    Unanswered | 0 Replies | 738 Views | Created by Starless2002 - Thursday, June 21, 2018 3:56 PM
  • large check mark
    0 Votes

    Tech support for Microsoft enterprise application block

    Archived Forums
     > 
    Code Contracts
    My organization uses Enterprise application block and need tech support with buffer issue in Enterprise application block. can someone point me to team or organization who currently supports this ...
    Unanswered | 0 Replies | 563 Views | Created by Baksh - Monday, February 26, 2018 10:54 PM
  • large check mark
    4 Votes

    Will Code Contracts support Visual Studio 2017?

    Archived Forums
     > 
    Code Contracts
    Are there plans for supporting the new tools and language features? Is there any timeline for that?
    Unanswered | 0 Replies | 1806 Views | Created by Maximilian Machedon - Wednesday, August 23, 2017 9:02 AM
  • large check mark
    0 Votes

    How to prove addition

    Archived Forums
     > 
    Code Contracts
    x' in S) holds, then S = N. Then you have to define addition recursively:   Def: Let a and b be in N. If b = 1, then define a + b = ...
    Unanswered | 0 Replies | 938 Views | Created by Activus - Wednesday, May 10, 2017 1:53 PM
  • large check mark
    0 Votes

    How i can added a progress bar in Excel Sheet with following Vba Cod ? any body can help me,?

    Archived Forums
     > 
    Code Contracts
    Dim objFSO As Object Dim objFolder As Object Dim count As Long Dim Path As String Dim ws As ...
    Unanswered | 0 Replies | 860 Views | Created by Saeed Ali Khan US - Thursday, May 4, 2017 9:07 AM
  • large check mark
    0 Votes

    silverlight

    Archived Forums
     > 
    Code Contracts
    Every time i try to download this software it says my computer already has it. I cant find the software on my computer. what should i do to go about downloading and using ...
    Unanswered | 0 Replies | 782 Views | Created by zachattack123 - Wednesday, May 3, 2017 10:01 PM
  • large check mark
    0 Votes

    MSXML:VBA : How to get Array Index of an XML element ?

    Archived Forums
     > 
    Code Contracts
    I have a requirement to convert the XML files to Excel. So i want to retrieve the XML as name value pairs and uniquely name the columns.  Is there any method to get the XML ...
    Unanswered | 0 Replies | 1130 Views | Created by vkumar-ms - Monday, April 3, 2017 9:21 PM
  • large check mark
    0 Votes

    Unity TypeLoadException - Could not load type because it declares a covariant or contravariant type parameter and is not an interface or delegate.

    Archived Forums
     > 
    Code Contracts
    Hi I am trying to implement a logger using the Unity Interceptor. It works for classes that do not implement an interface with type parameters but doesnt when interface does contain ...
    Unanswered | 0 Replies | 2033 Views | Created by Jody Petroni - Tuesday, March 14, 2017 11:28 AM
  • large check mark
    0 Votes

    Does Contract.Require make Contract.Assume redundant?

    Archived Forums
     > 
    Code Contracts
    = 0); Contract.Assume(x >= 0); x += 5; return x; }
    Unanswered | 0 Replies | 939 Views | Created by tristanrichter - Thursday, January 26, 2017 7:12 AM
  • large check mark
    1 Votes

    How exactly is the NuGet package supposed to work?

    Archived Forums
     > 
    Code Contracts
    How exactly is the NuGet package supposed to work? On my system it doesn't seem to have any effect at all on the project. There's no mention of it in any of the documentation that I can find. So could ...
    Unanswered | 0 Replies | 982 Views | Created by Tim Long - Saturday, January 21, 2017 9:31 PM
  • large check mark
    50 Votes

    Is Code Contracts dead?

    Archived Forums
     > 
    Code Contracts
    Sorry about the sensationalist title, but my intent is to be a bit blunt and try to elicit some response from the dev team on this. Wake up guys! The situation: After waiting for ...
    Answered | 31 Replies | 11021 Views | Created by Juan Gelós - Friday, February 15, 2013 4:56 PM | Last reply by OzBobWa - Friday, December 9, 2016 6:34 AM
  • large check mark
    1 Votes

    Can not find ContractInvariantMethodAttribute in Fakes.dll

    Archived Forums
     > 
    Code Contracts
    (CodeContractsRunCodeAnalysisInternal target) -> C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.QualityTools.Testing.Fakes.dll ...
    Answered | 4 Replies | 2781 Views | Created by gallóglaigh - Thursday, May 23, 2013 4:48 PM | Last reply by gallóglaigh - Tuesday, December 6, 2016 10:51 AM
  • large check mark
    0 Votes

    How to REALLY disable Code Contracts in a solution

    Archived Forums
     > 
    Code Contracts
    I've been trying to use CC but am about ready to give up on it. Every release brings a new headache. My solution has 30+ projects and hundreds of contracts. However, with Win10 Anniversary, I have ...
    Unanswered | 1 Replies | 2319 Views | Created by RKPatrick - Saturday, October 1, 2016 4:24 AM | Last reply by livioc - Thursday, November 10, 2016 11:50 AM
  • large check mark
    2 Votes

    Code Contracts requires .NET 3.5 to be installed?

    Archived Forums
     > 
    Code Contracts
    I have this error: C:\Program Files (x86)\Microsoft\Contracts\MsBuild\v4.0\Microsoft.CodeContractAnalysis.targets(238,5): error MSB4062: The ...
    Unanswered | 2 Replies | 2607 Views | Created by lostmsu - Thursday, December 11, 2014 5:27 AM | Last reply by RKPatrick - Friday, September 30, 2016 2:17 PM
  • large check mark
    0 Votes

    Capturing and saving image from camera using DirectShow

    Archived Forums
     > 
    Code Contracts
    Hello, I have a few compilation errors in my project. Please, advise me how can I correct those errors. I would be grateful for any help. Thanks There are the following errors ...
    Unanswered | 0 Replies | 1050 Views | Created by martynaslaw - Friday, September 9, 2016 11:37 AM
  • Items 1 to 20 of 2132 Next ›
Announcement: 9

Code Contracts announcement

  • Link
    Forum is closed
    Sandra Aldana - MSFT Friday, February 8, 2019 1:42 AM

    This forum is now closed. Thank you all for your participation.

    Regards,

    MSDN Forums team

  • Link
    CodeContracts Sources are now available on GitHub!!!
    Francesco Logozzo Tuesday, January 6, 2015 9:15 PM

    We just released the CodeContracts tools as Open Source on

    https://github.com/CodeContractsDotNet/CodeContracts

    We accept contribution!!!

    The CodeContracts team

  • Link
    CodeContracts Sources are now available on GitHub!!!
    Francesco Logozzo Tuesday, January 6, 2015 9:15 PM

    We just released the CodeContracts tools as Open Source on

    https://github.com/CodeContractsDotNet/CodeContracts

    We accept contribution!!!

    The CodeContracts team

  • Link
    New version of the tools released!!!! (v1.7.11106.10)
    Francesco Logozzo Monday, September 8, 2014 5:34 PM

    Better inference of object invariants for the static checker!

    Some bug fixes!

    Get it here: http://visualstudiogallery.msdn.microsoft.com/1ec7db13-3363-46c9-851f-1ce455f66970

  • Link
    New version released!!!! (v1.7.10903.10)
    Francesco Logozzo Monday, September 8, 2014 5:33 PM

    New checks, improved performances for the static checker

    Get it here: http://visualstudiogallery.msdn.microsoft.com/1ec7db13-3363-46c9-851f-1ce455f66970

  • Link
    NEW: CodeContracts Blog
    Francesco Logozzo Friday, September 5, 2014 12:07 AM

    Dear CC users,

      we are glad to announce the birth of a new blog on CodeContracts, static analysis etc: http://blogs.msdn.com/b/francesco/

  • Link
    It has happened. New VS2010 and VS2012 Contract editor extensions are available on the gallery
    RiSE (Research in Software Engineering) Tuesday, March 19, 2013 9:25 PM

    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.

    For VS2012:  http://visualstudiogallery.msdn.microsoft.com/02de7066-b6ca-42b3-8b3c-2562c7fa024f

    For VS2010: http://visualstudiogallery.msdn.microsoft.com/85f0aa38-a8a8-4811-8b86-e7f0b8d8c71b

    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.

    Enjoy.


  • Link
    External projects using Code Contracts?
    Mike Barnett Thursday, March 22, 2012 5:09 PM

    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.

    Thanks!

    Mike

  • Link
    Welcome to Code Contracts for .NET
    Mike Barnett Friday, 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.

Help us improve MSDN.
Visit our UserVoice Page to submit and vote on ideas!
Make a suggestion

Dev centers

  • Windows
  • Office
  • Visual Studio
  • Microsoft Azure
  • More...

Learning resources

  • Microsoft Virtual Academy
  • Channel 9
  • MSDN Magazine

Community

  • Forums
  • Blogs
  • Codeplex

Support

  • Self support

Programs

  • BizSpark (for startups)
  • Microsoft Imagine (for students)
United States (English)
  • Newsletter
  • Privacy & cookies
  • Terms of use
  • Trademarks
logo © 2019 Microsoft