This project is read-only.

Get code metrics in TFS 2013 build process



I want to get code metrics in the view summary of TFS 2013.

I made the steps required to get PowerTools for VS 2013 installed in the TFS and also in my development PC.

So, I am able to get "CodeMetrics" activity from toolbox and put it just after Compile and Test block of my build template.

When I queue a new build I obtain the following message:

Could not locate C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\FxCop\metrics.exe. Please download Visual Studio Code Metrics PowerTool 11.0 at

We are running TFS 2013 and using the version of TfsBuildExtensions.Activities.dll, which are accesible by the Build Agent and also by the solution that it is under source control. Also the template is under source control.

My doubts are related to:
  • Why is searching in \Microsoft Visual Stduo 11.0\ instead of \Microsoft Visual Studio 12.0\
  • I have replicated the content of \Microsoft Visual Studio 11.0\ in \Microsoft Visual Studio 12.0\ in order to enable the execution of metrics.exe and the message is the same. Then, I mean that I have some other part with an incorrect setup
  • Why the version of codemetrics activity of the toolbox is instead of If I have used the version of TfsBuildExtension.Activites.dll to get codemetrics listed in the toolbox
    ¿Any idea?
I know, and I have read that some "advanced" features can be obtained in the view summary related with Code Metrics, but for the moment I'm content to get the raw data displayed.

This issue has been reported before:

with no success and the last contribution was a year ago. The post talks about compatibility issues between this extension and TFS 2013.