0

I have got problem with Code analysis policy.

Must code analysis policy enforce users to fix code analysis warnings before check-in? If they don't, policy failure occurs. Is it wrong?

But when i am trying to check-in TFS my codes with code analysis warnings, i don't get any policy failures about this.

Is it normal?

bahadir arslan
  • 4,535
  • 7
  • 44
  • 82
  • [This link explains how the tfs checkin policy works with Code Analysis Warnings/Errors.](http://blogs.msdn.com/b/codeanalysis/archive/2011/04/06/preventing-check-ins-to-tfs-that-contain-code-analysis-warnings.aspx) – vjm Jul 10 '12 at 22:38

1 Answers1

0

Do you see check-in policy failure for CA errors? If not, then you would seem to have a problem. However, if you are seeing failures for errors but not for warnings, you are experiencing the expected behaviour. If you wish to prevent a check-in when a given rule fails, you must set violations of that rule to be treated as errors instead of as warnings. For Visual Studio 2010, this can most easily be done by editing your target CA ruleset.

Nicole Calinoiu
  • 20,843
  • 2
  • 44
  • 49
  • Thanks for your answer. But i am suprised a little bit. I know if i set a rule treat as error, i cannot check-in because of errors. But if i don't set a rule treat as error, doesn't check-in policy give me error about warnings? Are you sure? We were using it before upgrade TFS 2010... Can you share me the source (an article or guide about this)? – bahadir arslan Jan 21 '11 at 11:57