4.14. Code Contracts
Code contracts are a method for expressing constraints and assumptions within your code. They allow specification of complex rules that can be validated at both compile time and runtime. Code contracts are also supported in VS2008.
NOTE
Compile-time or static verification is available only in the Premium and Ultimate editions of Visual Studio. This is a real shame because it will probably prevent widespread adoption of this great technology rather than encouraging users to purchase a more expensive edition of Visual Studio (similar to MSTest and VS2005?). Hopefully this will not be permanent, and you will see static verification available in all future versions of Visual Studio.
In addition to providing validation, code ...
Get Introducing .NET 4.0: with Visual Studio 2010 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.