{"id":1893,"date":"2009-03-04T15:03:00","date_gmt":"2009-03-04T15:03:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2009\/03\/04\/preview-of-code-contract-tools-now-available\/"},"modified":"2021-10-04T15:44:51","modified_gmt":"2021-10-04T22:44:51","slug":"preview-of-code-contract-tools-now-available","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/preview-of-code-contract-tools-now-available\/","title":{"rendered":"Preview of Code Contract Tools Now Available"},"content":{"rendered":"<p style=\"margin: 0in 0in 10pt\" class=\"MsoNormal\"><span style=\"font-size: small\">We&rsquo;ve mentioned Code Contracts over on the <\/span><a href=\"http:\/\/blogs.msdn.com\/bclteam\/archive\/tags\/Contracts\/default.aspx\"><span style=\"color: #4f81bd;font-size: small\">BCL Blog<\/span><\/a><span style=\"font-size: small\"> a few times now, but never yet on the CLR Blog.<span>&nbsp; <\/span>Basically, Code Contracts are a way to add preconditions, post-conditions, and object invariants to your code.<span>&nbsp; <\/span>The goal is to help you catch developer errors earlier in the cycle.<span>&nbsp; <\/span>In my <\/span><a href=\"http:\/\/blogs.msdn.com\/bclteam\/archive\/2008\/11\/11\/introduction-to-code-contracts-melitta-andersen.aspx\"><span style=\"color: #4f81bd;font-size: small\">Introduction to Code Contracts<\/span><\/a><span style=\"font-size: small\"> post, I gave an overview of what had been included in the .NET Framework 4.0 CTP.<span>&nbsp; <\/span>I also mentioned that the tools to enable runtime checking and static analysis were not included in the .NET Framework 4.0 CTP.<\/span><\/p>\n<p style=\"margin: 0in 0in 10pt\" class=\"MsoNormal\"><span style=\"font-size: small\">On Monday, we released a preview version of the Code Contracts tools on the <\/span><a href=\"http:\/\/msdn.microsoft.com\/en-us\/devlabs\/dd125421.aspx\"><span style=\"color: #4f81bd;font-size: small\">DevLabs<\/span><\/a><span style=\"font-size: small\"> site.<span>&nbsp; <\/span>DevLabs is a site for getting preview releases of innovative new projects for developers out to the community.<span>&nbsp; <\/span>You can read more about it on <\/span><a href=\"http:\/\/blogs.msdn.com\/somasegar\/archive\/2008\/10\/23\/inspiring-through-innovation-devlabs.aspx\"><span style=\"color: #4f81bd;font-size: small\">Soma&rsquo;s introductory blog post<\/span><\/a><span style=\"font-size: small\">.<span>&nbsp; <\/span>The specific Code Contracts page on DevLabs can be found <\/span><a href=\"http:\/\/msdn.microsoft.com\/en-us\/dd491992.aspx\"><span style=\"color: #4f81bd;font-size: small\">here<\/span><\/a><span style=\"font-size: small\">.<\/span><\/p>\n<p style=\"margin: 0in 0in 10pt\" class=\"MsoNormal\"><span style=\"font-size: small\">The tools include a binary rewriter to enable runtime checking, a static checker, a new project pane for VS projects, and an updated copy of the Code Contract library that was shipped in the aforementioned CTP.<span>&nbsp; <\/span>For more details on what these are, you can check out the <\/span><a href=\"http:\/\/msdn.microsoft.com\/en-us\/dd491992.aspx\"><span style=\"color: #4f81bd;font-size: small\">Code Contracts page<\/span><\/a><span style=\"font-size: small\">, which includes an overview, a video on how to get started, an FAQ, and other useful information.<span>&nbsp; <\/span>You can also check out the <\/span><a href=\"http:\/\/download.microsoft.com\/download\/A\/1\/2\/A1220EB5-7CDD-403D-B94A-EEDFFA1848EB\/userdoc.pdf\"><span style=\"color: #4f81bd;font-size: small\">documentation<\/span><\/a><span style=\"font-size: small\"> (PDF), or get an overview in <\/span><a href=\"http:\/\/blogs.msdn.com\/somasegar\/archive\/2009\/02\/23\/devlabs-code-contracts-for-net.aspx\"><span style=\"color: #4f81bd;font-size: small\">Soma&rsquo;s recent post on Code Contracts<\/span><\/a><span style=\"font-size: small\">.<\/span><\/p>\n<p style=\"margin: 0in 0in 10pt\" class=\"MsoNormal\"><span style=\"font-size: small\">This current release is targeted at Visual Studio 2008 Team System and can be used for commercial development.<span>&nbsp; <\/span>The academic release that can be used for non-commercial use on any Visual Studio 2008 edition except Express can still be found on the <\/span><a href=\"http:\/\/research.microsoft.com\/en-us\/projects\/contracts\/\"><span style=\"color: #4f81bd\"><span style=\"font-size: small\"><span>&nbsp;<\/span>Contracts page<\/span><\/span><\/a><span style=\"font-size: small\"> on the Microsoft Research site.<\/span><\/p>\n<p style=\"margin: 0in 0in 10pt\" class=\"MsoNormal\"><span style=\"font-size: small\">This release also comes with more ways to provide feedback and get answers.<span>&nbsp; <\/span>In my introductory post on the BCL Blog, I mentioned the Code Contracts thread on the Pex forum.<span>&nbsp; <\/span>Now Code Contracts has its own <\/span><a href=\"http:\/\/social.msdn.microsoft.com\/Forums\/en-US\/codecontracts\/threads\/\"><span style=\"color: #4f81bd;font-size: small\">forum<\/span><\/a><span style=\"font-size: small\">.<span>&nbsp; <\/span>So please go try out these new tools and tell us what you think.<\/span><\/p>\n<p style=\"margin: 0in 0in 10pt\" class=\"MsoNormal\"><span style=\"font-size: small\">Thanks,<br>Melitta Andersen<br>Program Manager, CLR<\/span><\/p>\n<p style=\"margin: 0in 0in 10pt\" class=\"MsoNormal\"><span style=\"font-family: Calibri\"><\/span>&nbsp;<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&rsquo;ve mentioned Code Contracts over on the BCL Blog a few times now, but never yet on the CLR Blog.&nbsp; Basically, Code Contracts are a way to add preconditions, post-conditions, and object invariants to your code.&nbsp; The goal is to help you catch developer errors earlier in the cycle.&nbsp; In my Introduction to Code Contracts [&hellip;]<\/p>\n","protected":false},"author":342,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685],"tags":[],"class_list":["post-1893","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet"],"acf":[],"blog_post_summary":"<p>We&rsquo;ve mentioned Code Contracts over on the BCL Blog a few times now, but never yet on the CLR Blog.&nbsp; Basically, Code Contracts are a way to add preconditions, post-conditions, and object invariants to your code.&nbsp; The goal is to help you catch developer errors earlier in the cycle.&nbsp; In my Introduction to Code Contracts [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/1893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/342"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=1893"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/1893\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=1893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=1893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=1893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}