Can I use .NET 4 Code Contracts and remain compatible with .NET 3.5?

Posted by mafutrct on Stack Overflow See other posts from Stack Overflow or by mafutrct
Published on 2010-04-08T08:07:17Z Indexed on 2010/04/17 8:43 UTC
Read the original article Hit count: 173

Filed under:
|
|

.NET 4 introduced Code Contracts as a new feature. I'd like to use CC, but provide files that can still run in 3.5 SP1. Is that possible? Can I only use parts of the new functionality? Apparently it is possible to have CC only do static checks without being included in the binary files, is that correct?

I'm aware CC was available for 3.5 as separate module, is this a feasible workaround in case I can't use the 4 version of CC? Is there a difference in the feature set?

© Stack Overflow or respective owner

Related posts about .net-4.0

Related posts about .net-3.5