Code Contracts don't 'listen' to 'treat warnings as errors' setting - by Mark Blomsma

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 646880 Comments
Status Closed Workarounds
Type Bug Repros 3
Opened 2/24/2011 9:38:11 AM
Access Restriction Public


I'm using code contracts and found that when I change the build setting for my project to 'Treat warnings as errors' to All. That the warnings generated by code contracts as still warnings and not errors (I do not run the static checking in the background).
Sign in to post a comment.
Posted by Shawn Eary on 8/2/2012 at 7:14 PM
Unless I am missing something, this still seems to be broke even in VS2012 RC with 1.4.50327.0 (March 27, 2012). I understood that there was some talk of adding the "Treat Warnings As Errors" option in the Code Contract Tab also, but I seem to be having trouble finding such a Checkbox so I guess the bug is *still* broken even in 1.4.50327.0.
Posted by Stephen Drew on 10/16/2011 at 1:37 PM
I would also like this functionality - being able to fail a TFS build due to code contracts would be very useful.
Posted by Mark Blomsma on 4/5/2011 at 3:59 AM
Thank you for the explanation... and yes I would like to have that extra check box :)
Posted by Brian [MSFT] on 4/4/2011 at 3:35 PM
Thanks for the suggestion. We're electing not to fix this at this point in time.

To fix this would require adding a Treat Warnings As Errors option for our code contracts tools too - we believe it would be inappropriate to use the C# compiler's setting in the project file for this. (Note each .NET language would have a different setting.) Manuel points out that some of our users will want the C# compiler's setting enabled, but not have it apply to our code contracts tools, either the rewriter or the static checker.

We'll remember that you've asked for this, and will consider adding in a treat warnings as errors checkbox on the Code Contracts tab. But we are unlikely to add it at this point in time.
Posted by Microsoft on 3/4/2011 at 12:46 AM
Thank you for attaching the project to repro this issue. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution.These specialized experts will follow-up with your issue.
Posted by Mark Blomsma on 3/3/2011 at 5:23 AM
I've attached a sample.
Posted by Microsoft on 3/3/2011 at 12:33 AM
Hello again. We wanted to drop you a quick note given it's been 3 days since we requested some additional information. As we approach our release date, we have a limited window to reproduce and submit issues to the product team. To help expedite investigation of your issue, please provide the information requested earlier ASAP. If we do not hear back from you within 7 days, we will close this issue.

Thanks again for your efforts and we look forward to hearing from you.
Posted by Microsoft on 2/24/2011 at 8:12 PM
Thank you for reporting this issue.
But we were not able to reproduce it with the steps you provided. Could you please attach a demo project to help us investigate this issue?
Posted by Microsoft on 2/24/2011 at 10:13 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(