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 http://www.microsoft.com/en-gb/download/details.aspx?id=38196

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: https://social.msdn.microsoft.com/Forums/vstudio/en-US/6e647385-5a77-4d85-a0e7-4bddf388075d/auto-build-error-on-visual-studio-code-metrics-powertool?forum=tfsbuild

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