You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
Unfortunately, Roslyn compiler changed a lot of codegen and to add support for VS2017 reasonable amount of changes is required for all 3 projects: CCI, ccrewrite and cccheck.
Hopefully not, but significant amount of work is required to keep it alive.
Reacted by trident-job
Reacted by Neil Highley, Federico Ceccatto, pisystems and Jasmine Möller
Reacted by James Tharpe, Antão Almada, Christian Franzl, Sergio Rykov, Federico Ceccatto, DmitryGulin, Parris Lucas, Yuri, kleonardndb, michael-freidgeim-webjet and 8 more
I have the same issue, I bet on CC for some largish projects.
As much as I love it and will miss it, I think everyone should seriously consider getting them out of their code base sooner rather than later. There is just not enough commitment there from either MS or the volunteers here (I don't blame them, it was always made clear that it's a non supported technology).
I can only hope that the idea of CC will live on, there are proposals to bake contracts into C# and the runtime proper.
Reacted by Antão Almada, Matthieu Penant, Igor Wolbers, Michel Bretschneider, Andrew Nefedkin, Michael A. Volz (Flynn), Pawel Paczuski and Nikolas Kilian
It worked for me, but I have tried only with VS2015 compatible sources; from the comments above it seems to break as soon as you use any new VS2017 compiler feature.
It is my understanding that one of the issues is support for the new PDB format. I believe this can be worked around by switching back to the old format (setting Debug Type from Portable to Full or PdbOnly).
Is there a list of tasks that needs to be done to support VS2017? Anything up for grabs? We're also relying on CC heavily.
Reacted by Jeremy Caney, Dennis, Juliano Leal Goncalves, Igor Wolbers, Michael A. Volz (Flynn) and Vadim Vissotskyi
Very sad that such a great concept will die this way. Removed CC from most of my projects today and switched back to if throw guards. Will miss Interface Contracts though...
Well we've just gone through the process of converting all our code contracts to use a simple contracts replacement class that we wrote. No support for interface contracts, of course. Such a shame.
Would it be possible to create release of version, that is working on Visual Studio 2017? From what I've learned here, there is sort of working version available (#451).
Or at least post somewhere compiled binaries.
I have problems compiling it myself, since I could not find any detailed tutorial. There seems to be a lot of prerequisites, that are not mentioned anywhere.
I managed to build Code Contracts from master few month ago, after figuring out some error messages (like that I need to install tools for building C++ in Visual Studio) and adding some references to projects in solution.
Sadly, version that I managed to build does not work on new machine and now I've used Visual Studio 2017 instead of Visual Studio 2015 for building Code Contracts and I have another set of errors. And after few hours of solving the errors I've got stuck on this:
"c:\PathTo\CodeContracts\Microsoft.Research\ManagedContract.Setup\buildMSI10.xml" (All target) (1) -> "c:\PathTo\CodeContracts\CodeContracts.sln" (Clean;Rebuild target) (2) -> "c:\PathTo\CodeContracts\Microsoft.Research\ManagedContract.Setup\CCRefGenAttributes\CCRefGenAttributes.csproj" (Rebuild target) (70:2) -> (ContractDeclarativeAssemblyCS target) -> C:\Program Files (x86)\Microsoft\Contracts\Languages\CSharp\ContractDeclarativeAssemblyAttribute.cs(14,6): error CS0246: The type or namespace name 'ContractVerificationAttribute' could not be found (are you missing a using directive or an assembly reference?) [c:\Users\janpe\Development\C#\CodeContracts\Microsoft.Research\ManagedContract.Setup\CCRefGenAttributes\CCRefGenAttributes.csproj] C:\Program Files (x86)\Microsoft\Contracts\Languages\CSharp\ContractDeclarativeAssemblyAttribute.cs(14,6): error CS0246: The type or namespace name 'ContractVerification' could not be found (are you missing a using directive or an assembly reference?) [c:\Users\janpe\Development\C#\CodeContracts\Microsoft.Research\ManagedContract.Setup\CCRefGenAttributes\CCRefGenAttributes.csproj]
I is very annoying, that there is no release of Code Contracts for Visual Studio 2017. And even more so, that I'm not able to build it on my own.
As I read through issues here and on Stack Overflow, developers are abandoning Code Contracts because there is no version available for Visual Studio 2017 and soon I may be one of them.
I don't want to blame someone, that I'm not able to use it. I just want to say that it would be helpful for me and other developers to have access to compiled binaries of current version.
I did not know that Visual Studio 2013 is the only supported version (I've added this information on wiki).
I would also recommend to modify README.md, since instructions for building are incomplete (there is no mention about Visual Studio 2013 or Developer Command Prompt)
For working on the project, open CodeContracts.sln and build.
To create the installer and the nuget package, just run buildCC .
This is less than ideal. I'd already moved my projects from VS 2015 to VS 2017 when this gem popped up. Again. I'm glad I came upon this, and that VS2015 is still able to open projects that have been modified in VS 2017, because I'm gutting this from my code right now and not looking back...
Hopefully not, but significant amount of work is required to keep it alive.
will contract team start to rework code contracts to adopt with latest? I started to use code contracts (unaware of this issue) in my UWP projects. now I have to rollback everything :( Sergey Teplyakov (@SergeyTeplyakov)
Activity
SergeyTeplyakov commentedon Jan 5, 2017
Unfortunately, Roslyn compiler changed a lot of codegen and to add support for VS2017 reasonable amount of changes is required for all 3 projects: CCI, ccrewrite and cccheck.
RealDotNetDave commentedon Jan 5, 2017
Does that mean CC is dead in 2017?
SergeyTeplyakov commentedon Jan 5, 2017
Hopefully not, but significant amount of work is required to keep it alive.
RealDotNetDave commentedon Jan 5, 2017
Do you know a timeline? None of my DLL projects will compile.
chrisaut commentedon Jan 6, 2017
I have the same issue, I bet on CC for some largish projects.
As much as I love it and will miss it, I think everyone should seriously consider getting them out of their code base sooner rather than later. There is just not enough commitment there from either MS or the volunteers here (I don't blame them, it was always made clear that it's a non supported technology).
I can only hope that the idea of CC will live on, there are proposals to bake contracts into C# and the runtime proper.
ContentsMayVary commentedon Jan 9, 2017
It seems that some people have got it sort of working; see #451
tom-englert commentedon Jan 10, 2017
It worked for me, but I have tried only with VS2015 compatible sources; from the comments above it seems to break as soon as you use any new VS2017 compiler feature.
manison commentedon Jan 10, 2017
It is my understanding that one of the issues is support for the new PDB format. I believe this can be worked around by switching back to the old format (setting Debug Type from Portable to Full or PdbOnly).
Is there a list of tasks that needs to be done to support VS2017? Anything up for grabs? We're also relying on CC heavily.
wischi-chr commentedon Feb 25, 2017
Very sad that such a great concept will die this way. Removed CC from most of my projects today and switched back to if throw guards. Will miss Interface Contracts though...
ContentsMayVary commentedon Feb 28, 2017
Well we've just gone through the process of converting all our code contracts to use a simple contracts replacement class that we wrote. No support for interface contracts, of course. Such a shame.
RealDotNetDave commentedon Mar 13, 2017
I agree! Lots of code quality missing from .NET Core.
lesonkorenac commentedon Jun 29, 2017
Would it be possible to create release of version, that is working on Visual Studio 2017? From what I've learned here, there is sort of working version available (#451).
Or at least post somewhere compiled binaries.
I have problems compiling it myself, since I could not find any detailed tutorial. There seems to be a lot of prerequisites, that are not mentioned anywhere.
yaakov-h commentedon Jun 29, 2017
You can get the base functionality by building from master. Just run buildcc as outlined in the readme, from the Developer Command Prompt for VS2013.
lesonkorenac commentedon Jul 3, 2017
I managed to build Code Contracts from master few month ago, after figuring out some error messages (like that I need to install tools for building C++ in Visual Studio) and adding some references to projects in solution.
Sadly, version that I managed to build does not work on new machine and now I've used Visual Studio 2017 instead of Visual Studio 2015 for building Code Contracts and I have another set of errors. And after few hours of solving the errors I've got stuck on this:
"c:\PathTo\CodeContracts\Microsoft.Research\ManagedContract.Setup\buildMSI10.xml" (All target) (1) -> "c:\PathTo\CodeContracts\CodeContracts.sln" (Clean;Rebuild target) (2) -> "c:\PathTo\CodeContracts\Microsoft.Research\ManagedContract.Setup\CCRefGenAttributes\CCRefGenAttributes.csproj" (Rebuild target) (70:2) -> (ContractDeclarativeAssemblyCS target) -> C:\Program Files (x86)\Microsoft\Contracts\Languages\CSharp\ContractDeclarativeAssemblyAttribute.cs(14,6): error CS0246: The type or namespace name 'ContractVerificationAttribute' could not be found (are you missing a using directive or an assembly reference?) [c:\Users\janpe\Development\C#\CodeContracts\Microsoft.Research\ManagedContract.Setup\CCRefGenAttributes\CCRefGenAttributes.csproj] C:\Program Files (x86)\Microsoft\Contracts\Languages\CSharp\ContractDeclarativeAssemblyAttribute.cs(14,6): error CS0246: The type or namespace name 'ContractVerification' could not be found (are you missing a using directive or an assembly reference?) [c:\Users\janpe\Development\C#\CodeContracts\Microsoft.Research\ManagedContract.Setup\CCRefGenAttributes\CCRefGenAttributes.csproj]I is very annoying, that there is no release of Code Contracts for Visual Studio 2017. And even more so, that I'm not able to build it on my own.
As I read through issues here and on Stack Overflow, developers are abandoning Code Contracts because there is no version available for Visual Studio 2017 and soon I may be one of them.
I don't want to blame someone, that I'm not able to use it. I just want to say that it would be helpful for me and other developers to have access to compiled binaries of current version.
yaakov-h commentedon Jul 4, 2017
lesonkorenac
Use Visual Studio 2013. This is the only version that is actually supported as a build environment for Code Contracts.
You can download the AppVeyor build artifacts for master at https://ci.appveyor.com/project/SergeyTeplyakov/codecontracts/build/1.10.10311.145/artifacts
If you'd rather a NuGet package, I've uploaded a copy of the build I use here: https://github.com/WiseTechGlobal/CodeContracts/releases/tag/wtg%2Frel%2Fv1.10.20308.4
lesonkorenac commentedon Jul 5, 2017
Thank you. It helped a lot.
I did not know that Visual Studio 2013 is the only supported version (I've added this information on wiki).
I would also recommend to modify README.md, since instructions for building are incomplete (there is no mention about Visual Studio 2013 or Developer Command Prompt)
Thank you again.
AbbottWC commentedon Aug 4, 2017
This is less than ideal. I'd already moved my projects from VS 2015 to VS 2017 when this gem popped up. Again. I'm glad I came upon this, and that VS2015 is still able to open projects that have been modified in VS 2017, because I'm gutting this from my code right now and not looking back...
MkazemAkhgary commentedon Nov 23, 2017
will contract team start to rework code contracts to adopt with latest? I started to use code contracts (unaware of this issue) in my UWP projects. now I have to rollback everything :( Sergey Teplyakov (@SergeyTeplyakov)
yaakov-h commentedon Nov 23, 2017
Mohammad kazem Akhgari (@MkazemAkhgary) as far as I can tell, there is no contracts team any more. Don’t hold your breath.
MkazemAkhgary commentedon Nov 24, 2017
thanks for letting me know. I was late to the party but I think it was good feature. Yaakov (@yaakov-h)
MartinEgli commentedon Feb 9, 2018
Is there any version for Win10
yaakov-h commentedon Feb 10, 2018
OS version is irrelevant... this does work on Win10.
MartinEgli commentedon Feb 10, 2018
Does the msi install the tool on VS2017?
Mzangwe commentedon Apr 24, 2018
Team, hi
This works out of the box in Visual Studio 2017. It is part of the: System.Diagnostics.Contract.
See exemple below:
Contract.Requires<ArgumentNullException>(amount > 0, "Amount to deposit must be positive.");yaakov-h commentedon Apr 24, 2018
Without the tooling, that will only ever throw an exception saying you must use the rewriter.
alexagranov7 commentedon Feb 7, 2019
Is this for real?
adimosh commentedon Feb 7, 2019
Latest commit March 2017. I'd say this is the case.
yaakov-h commentedon Feb 7, 2019
That's just a merge commit. The most recent commit with content, authored by somebody at Microsoft, was May 2016.
Also, the last lead developer from Contracts left Microsoft Research for Facebook about a week after this repo was published...