After FxCop 10 Microsoft stopped shipping a separate installer for FxCop. Officially one can currently only run code analysis (FxCop 12.0 / 14.0 / 15.0) after installing Vis
If you have any FxCop rules enabled in your SonarQube quality profile, SonarQube requires FxCop 14.0.
These steps are largely based on the outstanding answer by @BatteryBackupUnit:
Install Microsoft Build Tools 2015 on the build machine.
Install Microsoft Visual C++ 2015 Redistributable Update 3, both x86 and x64, on the build machine.
Import the following registry file (update drive letter if not C:) on the build machine:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\WDExpress\14.0\Setup\EDev]
"StanDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Team Tools\\Static Analysis Tools\\"
"FxCopDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Team Tools\\Static Analysis Tools\\FxCop\\"
Copy all of %programfiles(x86)%\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools (not just the FxCop subdirectory) to the same place on the build machine.
Copy %programfiles(x86)%\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis to the same place on the build machine.
From the Global Assembly Cache (C:\Windows\Microsoft.NET\assembly\GAC_MSIL_NameOfTheAssembly_) of a computer where VS2015 is installed, copy Microsoft.VisualStudio.CodeAnalysis.dll and Microsoft.VisualStudio.CodeAnalysis.Sdk.dll (Make sure the DLLs are version 14.0!). Either copy to C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis on the build machine or install into the build machine's GAC.
If you see Phx.FatalError after all this - there's one last ritual...
Copy vs_profiler_x64_enu.exe from Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools\Setups and install it on the build machine.
Deviations from @BatteryBackupUnit's instructions:
Static Analysis Tools directory is needed, not just the FxCop subdirectory.msdia120.dll and amd64\msdia140.dll files into the FxCop directory seems unnecessary so long as the Visual C++ 2015 Redistributable is installed.Custom.CodeAnalysis.targets file.