Legacy FxCop and FxCop analyzers

Legacy FxCop

Legacy FxCop runs post-build analysis on a compiled assembly. It runs as a separate executable called FxCopCmd.exe. FxCopCmd.exe loads the compiled assembly, runs code analysis, and then reports the results


Running Legacy FxCop: When you select Analyze > Run Code Analysis, it executes static code analysis or legacy FxCop. Run Code Analysis has no effect on Roslyn-based analyzers, including the Roslyn-based FxCop analyzers.

FxCop Analyzer

FxCop analyzers run source-code based analysis during compiler execution. FxCop analyzers are hosted within the compiler process, either csc.exe or vbc.exe, and run analysis when the project is built. Analyzer results are reported along with compiler results.

Running FxCop Analyzer: To run FxCop analyzers, first install the NuGet package for them. Then build your project or solution from Visual Studio or using msbuild. The warnings and errors that the FxCop analyzers generate will appear in the Error List or the command window.