2

We have upgraded our TFS 2008 to TFS 2010 and our VS 2008 projects to VS 2010 in last weeks. We are using Code Analysis to improve our coding quality.

But we have some problems about Code Analysis Check-in Policy.

When we run code analysis on project, we get warnings about code analysis. But if we try to check-in without fix it, we expect to warned about policy fails by VS 2010; but VS 2010 does not warn us and TFS 2010 accept check-in.

So how can we solve this.

We want that team members warned about code analysis warnings before check-in if project has.

bahadir arslan
  • 4,535
  • 7
  • 44
  • 82

1 Answers1

1

There is an easy way to do this, but you may not like it.

  1. Create a Code Analysis list in your solution Code Analysis Rule Set Figure: You can add Code Analysis configuration to a solution

  2. Configure the rules Configure Code Analysis Rules Figure: Setting Rules to error will prevent a build from succeeding

Now that you have this configured you will be able to set some of the rules to error out and thus preventing check-in based on the Build not being successfully.

  • Thanks for you answer; but yes, you are right i don't like it :) I wonder that, must TFS enforce me to fix all code analysis warnings while check-in? Am i wrong? – bahadir arslan Jan 13 '11 at 12:56