in

Dé specialist in .NET trainingen en consultancy

Jo-wen Mei

Code Contracts in VS2010 Beta 2

Code Contracts helps to reduce bugs by helping you not write them in the first place, or at least catch them sooner.

They allow the developer to specify pre- and postconditions and more.

To use this stuff in Visual Studio 2008 you had to download and install a separate tool.

I’m experimenting with this stuff the first time in Visual Studio 2010, and NetFx 4 contains the System.Diagnostics.Contracts.Contract class, so I assumed everything was in the box…….  [insert quote with assumption and f*ckup here]

The only thing that ships in the SDK is the contract class - this makes it possible to author contracts and compile code containing contracts without an extra download. But the contracts have no effect in this scenario. So the tools need to be downloaded from DEVLABS to acquire all the functionality!!!

The team decided to stay out of the Visual Studio train, so they can update it more frequently. They’re trying to have a monthly release cycle.

forum (with a link to the latest download)

 

note: after installing the tool, you should get an extra tab in the project-properties page which contains some cool settings. I had to restart Visual Studio before it popped up!

Comments

No Comments