Tuesday, March 12, 2013

CodeMetrics and VS 2012 workaround

As it is for now, running metrics.exe on a machine which doesn't have VS 2010 gives you an error:

Could not locate C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\metrics.exe. Please download Visual Studio Code Metrics PowerTool 10.0 at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=edd1dfb0-b9fe-4e90-b6a6-5ed6f6f6e615

Downloading and installing as it says - doesn't really help, it gives yet another error about missing dll or one of its dependencies.

So, to be able to run code metrics tool on a machine without VS 2010 installed, do the following:

1. Create folder C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools
2. Copy over the whole Static Analysis Tools folder there from the machine with VS2010.
3. Copy Microsoft.VisualC.dll version 10.0.0.0 to the FxCop subfolder of Static Analysis Tools folder.

This made the trick.

UPDATE: It's finally there! See CodeMetrics for VisualStudio 2012.

No comments:

Post a Comment