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
      • SharePoint Server 2013 resources
      • SQL Server 2014 Express resources
      • Windows Server 2012 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: 8

Code Contracts announcement

  • Link
    CodeContracts Sources are now available on GitHub!!!
    Francesco Logozzo Tuesday, January 06, 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 06, 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 08, 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 08, 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 05, 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.

  • 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

    Tech support for Microsoft enterprise application block

    DevLabs
     > 
    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 | 31 Views | Created by Baksh - Monday, February 26, 2018 10:54 PM
  • large check mark
    0 Votes

    Will Code Contracts support Visual Studio 2017?

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

    How to prove addition

    DevLabs
     > 
    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 | 356 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,?

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

    silverlight

    DevLabs
     > 
    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 | 252 Views | Created by zachattack123 - Wednesday, May 03, 2017 10:01 PM
  • large check mark
    0 Votes

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

    DevLabs
     > 
    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 | 417 Views | Created by vkumar-ms - Monday, April 03, 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.

    DevLabs
     > 
    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 | 747 Views | Created by Jody Petroni - Tuesday, March 14, 2017 11:28 AM
  • large check mark
    0 Votes

    Does Contract.Require make Contract.Assume redundant?

    DevLabs
     > 
    Code Contracts
    = 0); Contract.Assume(x >= 0); x += 5; return x; }
    Unanswered | 0 Replies | 389 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?

    DevLabs
     > 
    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 | 436 Views | Created by Tim Long - Saturday, January 21, 2017 9:31 PM
  • large check mark
    50 Votes

    Is Code Contracts dead?

    DevLabs
     > 
    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 | 9854 Views | Created by Juan Gelós - Friday, February 15, 2013 4:56 PM | Last reply by OzBobWa - Friday, December 09, 2016 6:34 AM
  • large check mark
    1 Votes

    Can not find ContractInvariantMethodAttribute in Fakes.dll

    DevLabs
     > 
    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 | 2049 Views | Created by gallóglaigh - Thursday, May 23, 2013 4:48 PM | Last reply by gallóglaigh - Tuesday, December 06, 2016 10:51 AM
  • large check mark
    0 Votes

    How to REALLY disable Code Contracts in a solution

    DevLabs
     > 
    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 | 1297 Views | Created by RKPatrick - Saturday, October 01, 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?

    DevLabs
     > 
    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 | 1804 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

    DevLabs
     > 
    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 | 499 Views | Created by martynaslaw - Friday, September 09, 2016 11:37 AM
  • large check mark
    1 Votes

    reporting error of 'could not find library Microsoft.VisualBasic.dll' when building CodeContracts in VS 2015

    DevLabs
     > 
    Code Contracts
     Built PresentationCore for .NETFramework\v4.0\, .NETFramework\v4.5\, .NETFramework\v4.6\ 23>vbc : error BC2017: could not find library ...
    Unanswered | 0 Replies | 601 Views | Created by LeoYin - Friday, August 26, 2016 3:14 AM
  • large check mark
    1 Votes

    Will Nuget package be updated?

    DevLabs
     > 
    Code Contracts
    Just wondering if the Nuget package will be getting updated in the future, or if we wish to use recent fixes do we need to clone the source and build ourselves? According to the ...
    Unanswered | 0 Replies | 522 Views | Created by remids - Friday, August 12, 2016 1:15 PM
  • large check mark
    0 Votes

    Donload delivers wrong file

    DevLabs
     > 
    Code Contracts
    Hi folks, I am downloading from the official website ...
    Unanswered | 1 Replies | 581 Views | Created by mph_62 - Wednesday, June 01, 2016 12:51 PM | Last reply by nbulp - Wednesday, June 08, 2016 10:35 AM
  • large check mark
    11 Votes

    Critical Bug in Code Contracts rewriter - Code is moved out of try/catch block on build

    DevLabs
     > 
    Code Contracts
    Problem is decribed in the following post and answer: http://stackoverflow.com/questions/10866307/why-net-exception-is-not-caught/10866308#10866308 I would ...
    Answered | 3 Replies | 4398 Views | Created by Alexander Bartosh - Saturday, June 02, 2012 10:17 PM | Last reply by Alexander Bartosh - Wednesday, May 11, 2016 7:46 AM
  • large check mark
    0 Votes

    What ForAll statements can be proven? Simple examples are not working!

    DevLabs
     > 
    Code Contracts
    n % 2 == 0)); } } static bool Even(int[] numbers) { Contract.Requires(numbers != null); Contract.Ensures(!Contract.Result<bool>() || ...
    Discussion | 1 Replies | 666 Views | Created by erisco - Saturday, April 09, 2016 6:26 PM | Last reply by erisco - Saturday, April 09, 2016 8:00 PM
  • large check mark
    0 Votes

    trying to write a code for a class and im not sure where to start

    DevLabs
     > 
    Code Contracts
    Your application must do the following: Print a “welcome” message to the user telling them that this ...
    Unanswered | 0 Replies | 753 Views | Created by seang118 - Thursday, March 31, 2016 6:51 PM
  • Items 1 to 20 of 2126 Next ›
Announcement: 8

Code Contracts announcement

  • Link
    CodeContracts Sources are now available on GitHub!!!
    Francesco Logozzo Tuesday, January 06, 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 06, 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 08, 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 08, 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 05, 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.


Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.

Would you like to participate?

  
Privacy statement
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 © 2018 Microsoft