Code Contract support?

micah's Avatar

micah

14 Jul, 2014 05:46 AM

Do the build servers have the Microsoft Code Contracts tools installed? Is it possible to install them? If not, what is the best solution for this sort of problem? Setup a build script that downloads the tools first then runs them as a after build?

Here is some information on running Microsoft Code Contracts on a build server:
http://stackoverflow.com/questions/3569108/microsoft-code-contracts...

If the best solution is to have them downloaded on build then I will probably make a NuGet package that contains the binaries and adds the necessary targets to make it all work.

  1. Support Staff 1 Posted by Feodor Fitsner on 14 Jul, 2014 06:31 AM

    Feodor Fitsner's Avatar

    We'll deploy code contracts on build worker images.

  2. Support Staff 2 Posted by Feodor Fitsner on 14 Jul, 2014 10:07 AM

    Feodor Fitsner's Avatar

    It's been deployed to build worker images. Give it a try and let me know how it goes.

  3. 3 Posted by micah on 14 Jul, 2014 04:49 PM

    micah's Avatar

    Thanks! I'm heading to a 3 day conference this afternoon but I'll see if I can get it working before I leave. If not, then definitely later this week.

  4. 4 Posted by micah on 15 Jul, 2014 01:39 AM

    micah's Avatar

    Wow, that just worked out of the box. All I had to do was kick off another build (was previously failing).

    Thanks!

  5. Support Staff 5 Posted by Feodor Fitsner on 15 Jul, 2014 05:27 AM

    Feodor Fitsner's Avatar

    Great, thanks for the update!

  6. 6 Posted by cyclotis04 on 29 Jul, 2015 06:23 PM

    cyclotis04's Avatar

    Sorry to reopen an old topic, but can support be added for the Visual Studio 2015 environment? Code Contract support for VS 2015 just came out a couple weeks ago.

    I'm testing support here: https://ci.appveyor.com/project/dlras2/nugetpackagetemplate

  7. Support Staff 7 Posted by Feodor Fitsner on 29 Jul, 2015 08:22 PM

    Feodor Fitsner's Avatar

    Sure, I've added a new issue: https://github.com/appveyor/ci/issues/346

  8. 8 Posted by cyclotis04 on 29 Jul, 2015 08:25 PM

    cyclotis04's Avatar

    Thanks! Am I correct in my understanding that I will need to stay on the Visual Studio 2015 environment for the time being? (That is, the default one is not being updated in-place.)

  9. Support Staff 9 Posted by Feodor Fitsner on 29 Jul, 2015 08:27 PM

    Feodor Fitsner's Avatar

    We are bringing VS 2015 to Pro environment this week.

  10. Support Staff 10 Posted by Feodor Fitsner on 29 Jul, 2015 11:24 PM

    Feodor Fitsner's Avatar

    Btw, you can install code contracts with this script: https://gist.github.com/FeodorFitsner/9769cb61790387005445

  11. 11 Posted by cyclotis04 on 30 Jul, 2015 12:31 AM

    cyclotis04's Avatar

    Thanks! That worked, though it added 20 minutes to my build time, so I'll keep an eye out for a resolution to that GitHub issue!

  12. Support Staff 12 Posted by Feodor Fitsner on 10 Aug, 2015 04:25 AM

    Feodor Fitsner's Avatar

    It's been deployed, no need to install it during the build anymore.

  13. 13 Posted by Eugene Auduchin... on 06 Jul, 2016 02:59 PM

    Eugene Auduchinok's Avatar

    Please update the package to a newer release which fixes some serious bugs.
    https://github.com/Microsoft/CodeContracts/releases

  14. Support Staff 14 Posted by Feodor Fitsner on 06 Jul, 2016 03:22 PM

    Feodor Fitsner's Avatar

    There is RC2. We'd prefer to wait for RTM before rolling it out to all build workers.

    Also, I've noticed there is a nuget package for Code Contracts - I'm wondering if this is an alternative way to install/use CC going forward?

  15. 15 Posted by Eugene Auduchin... on 07 Jul, 2016 07:30 AM

    Eugene Auduchinok's Avatar

    It's about a year now from the moment CodeContracts doesn't depend of VS2013 build tools anymore. We have to install msi on every build to work with 2015 build tools (which is needed for F# 4.0).
    Even though it is labeled as a pre-release, it fixes so much that it can be more stable the old release that is deployed now.

    And the NuGet package is indeed the the RC2.

  16. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:07 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac