Mike Barnett - Getting started with Code Contracts in Visual Studio 2008
- Posted: Feb 23, 2009 at 2:40 PM
- 58,342 Views
- 11 Comments
Download
How do I download the videos?
- To download, right click the file type you would like and pick “Save target as…” or “Save link as…”
Why should I download videos from Channel9?
- It's an easy way to save the videos you like locally.
- You can save the videos in order to watch them offline.
- If all you want is to hear the audio, you can download the MP3!
Which version should I choose?
- If you want to view the video on your PC, Xbox or Media Center, download the High Quality WMV file (this is the highest quality version we have available).
- If you'd like a lower bitrate version, to reduce the download time or cost, then choose the Medium Quality WMV file.
- If you have a Zune, WP7, iPhone, iPad, or iPod device, choose the low or medium MP4 file.
- If you just want to hear the audio of the video, choose the MP3 file.
Right click “Save as…”
- High Quality WMV (PC, Xbox, MCE)
- MP3 (Audio only)
- MP4 (iPod, Zune HD)
- Mid Quality WMV (Lo-band, Mobile)
The Code Contracts library can be downloaded for Visual Studio 2008 from the DevLabs web site. They will be part of the .Net framework 4.0!!!
- Contracts @ DevLabs: http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx
- Contracts @ Microsoft Research: http://research.microsoft.com/contracts
- Contracts forums: http://social.msdn.microsoft.com/Forums/en-US/codecontracts/threads/
The Research in Software Engineering team (RiSE) coordinates Microsoft's research in Software Engineering in Redmond, USA.
Comments Closed
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
There are several reasons to put the contracts into the code as opposed to using custom attributes. hillr's reply is definitely one of the big reasons. You can see our comments on this topic in our FAQ: http://msdn.microsoft.com/en-us/devlabs/dd492004.aspx.
Question I have is can the preconditions only go in the constructor? It makes sense to me that this would be the case, but I figued I'd ask just in case. I have a custom attribute where I need to check if a variable object inplements a specific interface, but the object is passed in a method and not in the constructor.
Thanks,
DoN
Thanks!
Thank you for the demonstration, I have put aside all my free time to try this out.
the static check in perticular is really cool
is there a way to customise the runtime checks a little more though? [i just watched the video so this might be obvious in practice]
Ensuring that your class is in a correct state would extremely cut back on how often you have to validate your code.
I'm going to start using this right away.
Does anyone know if I can use this with Windows Mobile development in Visual Studio?
--edit--
oh wait, there is one for pro as well
(use the second link, not the devlabs one)
Remove this comment
Remove this thread
close