<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Preview of Code Contract Tools Now Available [Melitta Andersen]</title><link>http://blogs.msdn.com/bclteam/archive/2009/02/23/preview-of-code-contract-tools-now-available-melitta-andersen.aspx</link><description>In my Introduction to Code Contracts post, I mentioned that the tools to enable runtime checking and static analysis were not included in the .NET Framework 4.0 CTP. Today we are releasing a preview version of the Code Contracts tools on the DevLabs site.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Click &amp;amp; Solve &amp;raquo;  Preview of Code Contract Tools Now Available [Melitta Andersen] </title><link>http://blogs.msdn.com/bclteam/archive/2009/02/23/preview-of-code-contract-tools-now-available-melitta-andersen.aspx#9441939</link><pubDate>Tue, 24 Feb 2009 03:05:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9441939</guid><dc:creator>Click &amp;amp; Solve &amp;raquo;  Preview of Code Contract Tools Now Available [Melitta Andersen] </dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.clickandsolve.com/?p=13459"&gt;http://www.clickandsolve.com/?p=13459&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Preview of Code Contract Tools Now Available [Melitta Andersen]</title><link>http://blogs.msdn.com/bclteam/archive/2009/02/23/preview-of-code-contract-tools-now-available-melitta-andersen.aspx#9442190</link><pubDate>Tue, 24 Feb 2009 08:08:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9442190</guid><dc:creator>David Nelson</dc:creator><description>&lt;p&gt;Melitta,&lt;/p&gt;
&lt;p&gt;Do you know why the &amp;quot;academic&amp;quot; version works on any non-express SKU, while the &amp;quot;commercial&amp;quot; version only works on Team System? My organization uses Professional, which means that as of now we are prevented from using Code Contracts in any of our applications, for no good reason that I can see.&lt;/p&gt;
&lt;p&gt;Someone who were inclined toward conspiracy theories might think it was yet another way to force people into buying a more expensive SKU that they don't need...&lt;/p&gt;
</description></item><item><title>re: Preview of Code Contract Tools Now Available [Melitta Andersen]</title><link>http://blogs.msdn.com/bclteam/archive/2009/02/23/preview-of-code-contract-tools-now-available-melitta-andersen.aspx#9442329</link><pubDate>Tue, 24 Feb 2009 11:39:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9442329</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;Am I correct in understanding that Code Contracts.NET is not supported for Visual Studio 2008 Professional edition? If so, please provide the motivation behind this.&lt;/p&gt;
</description></item><item><title>re: Preview of Code Contract Tools Now Available [Melitta Andersen]</title><link>http://blogs.msdn.com/bclteam/archive/2009/02/23/preview-of-code-contract-tools-now-available-melitta-andersen.aspx#9442380</link><pubDate>Tue, 24 Feb 2009 12:20:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9442380</guid><dc:creator>Chris Varley</dc:creator><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;You don't need to but a more expensive SKU. ContractDriven hosted on CodePlex.&lt;/p&gt;
&lt;p&gt;(&lt;a rel="nofollow" target="_new" href="http://www.codeplex.com/contractdriven"&gt;http://www.codeplex.com/contractdriven&lt;/a&gt;) provides a very similar syntax and has the benefit that it's both Open Source and free.&lt;/p&gt;
&lt;p&gt;It does not currently have any static analysis but it works in VS 2008.&lt;/p&gt;
</description></item><item><title>re: Preview of Code Contract Tools Now Available [Melitta Andersen]</title><link>http://blogs.msdn.com/bclteam/archive/2009/02/23/preview-of-code-contract-tools-now-available-melitta-andersen.aspx#9442696</link><pubDate>Tue, 24 Feb 2009 17:34:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9442696</guid><dc:creator>Jonathan Pryor</dc:creator><description>&lt;p&gt;Haven't tried code contracts yet, but I did read the PDF documentation.&lt;/p&gt;
&lt;p&gt;That being said...is it too late to change the design?&lt;/p&gt;
&lt;p&gt;What I find...troubling, or at least bizarre, is the implicit semantic change in argument validation.&lt;/p&gt;
&lt;p&gt;Since before .NET 1.0, validation has been manual, yes, but it has also been exception based:&lt;/p&gt;
&lt;p&gt;public void Foo(string s) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp;if (s == null) throw new ArgumentNullException(&amp;quot;s&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;...&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Code contracts present a nicer interface to do the same thing:&lt;/p&gt;
&lt;p&gt;public void Foo(string s) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Contract.Requires(s != null);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;...&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Personally, I like the syntax.&lt;/p&gt;
&lt;p&gt;However, from reading the documentation, the resulting runtime behavior effectively results in:&lt;/p&gt;
&lt;p&gt;public void Foo(string s) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp;if (s == null) Environment.FailFast(&amp;quot;s != null&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;...&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;So if we pass an invalid argument, we kill the process with extreme prejudice.&lt;/p&gt;
&lt;p&gt;Isn't that just a little...excessive?&lt;/p&gt;
&lt;p&gt;Furthermore, at least on .NET 2.0, Environment.FailFast() doesn't provide a stack trace for the error. &amp;nbsp;So not only does it kill the process with extreme prejudice, it doesn't provide the developer any easy way to find where they went wrong. &amp;nbsp;(On a slightly related note... &amp;nbsp;What are you thinking?!?!?!)&lt;/p&gt;
&lt;p&gt;Fortunately this can be changed by using the Contract.ContractFailed event or using the RuntimeFailureMethods type listed in &amp;#167;7.1, but I find this inadequte, as e.g. RuntimeFailureMethods.Requires() wouldn't be able to distinguish between throwing an ArgumentNullException() vs. another ArgumentException() subclass (unless you resort to parsing the condText string, which is error-prone).&lt;/p&gt;
&lt;p&gt;So is there any chance the default behavior of Contrace.Requires() could be changed to follow &amp;quot;traditional&amp;quot; argument validation principals -- using useful Argument* exceptions, etc.?&lt;/p&gt;
</description></item><item><title>re: Preview of Code Contract Tools Now Available [Melitta Andersen]</title><link>http://blogs.msdn.com/bclteam/archive/2009/02/23/preview-of-code-contract-tools-now-available-melitta-andersen.aspx#9443081</link><pubDate>Tue, 24 Feb 2009 22:46:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9443081</guid><dc:creator>Jeff Lewis</dc:creator><description>&lt;p&gt;No disrespect intended, but I've been digging through this thread right from the RSS feed posted in Channel 9 today and several people have asked 'why does the commercial license only work with Team Studio while the non-commercial license work with the other versions?'&lt;/p&gt;
&lt;p&gt;None of the responses so far are actually answers. They either point to other posts which essentially say the same thing: commercial needs TS and non-commercial works on everything else but Express - which we KNOW already or else we wouldn't be asking the question.&lt;/p&gt;
&lt;p&gt;Pointing us to the 'freeware' version isn't an answer either. It's trying to dodge the answer. If the freeware version was a good as the full version, you wouldn't need a license.&lt;/p&gt;
&lt;p&gt;The obvious answer is: this forces you to buy TS. That's actually ok - it's Microsoft's product and they have every right to try to tie a new feature to a specific level in order to improve sales of that level. But that will also seriously depress uptake on that feature.&lt;/p&gt;
&lt;p&gt;I'm not in a team for most of my development, and so any of the team products are way over the top for me. On the other hand, I do produce commercial products. Which means that Contract library as provided by Microsoft isn't going to a part of my development process.&lt;/p&gt;
&lt;p&gt;Perhaps it would be better to sell these add-ons individually and let us decide which pieces we want?&lt;/p&gt;
</description></item><item><title>The VSTS Restriction</title><link>http://blogs.msdn.com/bclteam/archive/2009/02/23/preview-of-code-contract-tools-now-available-melitta-andersen.aspx#9443428</link><pubDate>Wed, 25 Feb 2009 04:25:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9443428</guid><dc:creator>Melitta Andersen</dc:creator><description>&lt;p&gt;Code Contracts will ship as part of .NET Framework 4 and Visual Studio 2010. &amp;nbsp;For Visual Studio 2010, we’re still working out the details regarding which Visual Studio products will have tooling support for Code Contracts. &amp;nbsp;We think there is value in offering some level of tooling support in more than just the Team System products, but we haven’t finalized our plans.&lt;/p&gt;
&lt;p&gt;As requested, this is the first preview release that can be used for commercial development (previous previews were for academic use only). &amp;nbsp;Like most of the other technology previews on DevLabs (e.g. Pex and Chess), Visual Studio Team System 2008 is required. &amp;nbsp;The reason for the Team System requirement is because we haven’t worked through the details of whether we could incorporate a technology in a particular product after having previously given it away with no restrictions first. &amp;nbsp;The same issue would apply if we were to do something like Jeff suggested and sell the add-ons individually.&lt;/p&gt;
&lt;p&gt;We’re glad to hear that there’s such a demand for this feature from customers. &amp;nbsp;Your feedback will help shape our thinking as we finalize our plans for Visual Studio 2010.&lt;/p&gt;
</description></item><item><title>re: Preview of Code Contract Tools Now Available [Melitta Andersen]</title><link>http://blogs.msdn.com/bclteam/archive/2009/02/23/preview-of-code-contract-tools-now-available-melitta-andersen.aspx#9443556</link><pubDate>Wed, 25 Feb 2009 07:39:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9443556</guid><dc:creator>David Nelson</dc:creator><description>&lt;p&gt;Melitta,&lt;/p&gt;
&lt;p&gt;I am confused as to why, even in your comment, you seem to assume that these features will be included in Team System &amp;quot;by default&amp;quot;, and will only be included in &amp;quot;lower&amp;quot; SKUs if enough &amp;quot;value&amp;quot; is found for them. Code Contracts are not a &amp;quot;Team&amp;quot; feature, they are a code feature. I am a professional programmer, and I use the Professional Edition. I don't use Team System because I don't need all of the &amp;quot;team&amp;quot;-oriented features that it provides (source control, task tracking, automated builds, etc). I could, however, make use of Code Contracts, just as much as any development team could.&lt;/p&gt;
&lt;p&gt;There is no reason why Code Contracts should be considered a &amp;quot;team&amp;quot; feature. The fact that Code Contracts are only being considered for Team System indicates that Microsoft is using some other criteria for determining what goes in each SKU. If that is the case, the SKUs should at least be renamed to more accurately reflect their intended use cases.&lt;/p&gt;
</description></item><item><title>re: Preview of Code Contract Tools Now Available [Melitta Andersen]</title><link>http://blogs.msdn.com/bclteam/archive/2009/02/23/preview-of-code-contract-tools-now-available-melitta-andersen.aspx#9443580</link><pubDate>Wed, 25 Feb 2009 08:26:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9443580</guid><dc:creator>cnkz</dc:creator><description>&lt;p&gt;@David (last paragraph actually): &amp;nbsp;Absolutely. &amp;nbsp;One thing that I never understood is why fxcop is only integrated in the team system SKU, and not in professional. &amp;nbsp;Same thing now with code contracts - it seems. &amp;nbsp;Looks like that the team system SKU should be the really called &amp;quot;professional&amp;quot;...&lt;/p&gt;
</description></item><item><title>re: Preview of Code Contract Tools Now Available [Melitta Andersen]</title><link>http://blogs.msdn.com/bclteam/archive/2009/02/23/preview-of-code-contract-tools-now-available-melitta-andersen.aspx#9447649</link><pubDate>Fri, 27 Feb 2009 02:31:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9447649</guid><dc:creator>Arman K</dc:creator><description>&lt;p&gt;I can not but agree with Jonathan Pryor, even though I can understand why you are using FailFast, but I too would like to handle contract error like Jonathan says. I was thinking case when using Contract for WCF service, it will crash my service by FailFast and not providing me with the error.&lt;/p&gt;
</description></item><item><title>re: Preview of Code Contract Tools Now Available [Melitta Andersen]</title><link>http://blogs.msdn.com/bclteam/archive/2009/02/23/preview-of-code-contract-tools-now-available-melitta-andersen.aspx#9467004</link><pubDate>Mon, 09 Mar 2009 04:49:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9467004</guid><dc:creator>The Q</dc:creator><description>&lt;p&gt;I would also like to see some improvements in regards to integration with WCF.&lt;/p&gt;
&lt;p&gt;I wrote a blog post about getting the code contracts for a WCF service working on the client side, which was easier than I thought, but did nevertheless require some tinkering which the casual coder might not find all too intuitive.&lt;/p&gt;
&lt;p&gt;Please have a look and let me know if there is a more convenient way of achieving this.&lt;/p&gt;
&lt;p&gt;Blog post can be found at:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.hexadecimal.se/2009/03/09/WritingRockSolidCodeWithCodeContracts.aspx"&gt;http://www.hexadecimal.se/2009/03/09/WritingRockSolidCodeWithCodeContracts.aspx&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>