Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which 3rd party Code-by-Contract library is most like MS's .NET 4.0 library?

I want to jump into coding by contract. I got VS2010 (with the C# 4.0 compiler) but I have to target the 3.5 framework.

What 3rd party code by contract library has classes and interface the most like the .NET 4.0 ones?

like image 312
MatthewMartin Avatar asked Jan 23 '23 01:01

MatthewMartin


1 Answers

From the user guide:

Starting with the CLR v4, the Contract class and related types reside in mscorlib.dll. Prior to CLR v4, these types appear in a separate assembly called Microsoft .Contracts. dll that is installed under %PROGRAMFILES%/Microsoft/Contracts/PublicAssemblies. You can need to add a reference to this assembly if you are compiling against a pre 4.0 CLR.

You may have some interesting issues if you want to use the same built assembly against both 3.5 and 4.0 (I don't know - it may just work) but if you're just using 3.5, that should be okay.

The extension installs into VS2008 as well as VS2010, I believe.

like image 62
Jon Skeet Avatar answered Feb 16 '23 01:02

Jon Skeet