Migrate from legacy analysis (FxCop) to source analysis (FxCop analyzers)

Source analysis by .NET Compiler Platform ("Roslyn") analyzers replaces legacy analysis for managed code. For newer project templates such as .NET Core and .NET Standard projects, legacy analysis is not available.

Many of the legacy analysis (FxCop) rules have already been rewritten for FxCop analyzers, a set of Roslyn code analyzers. You install FxCop analyzers as a NuGet package that's referenced by the project or solution. FxCop analyzers run source-code based analysis during compiler execution. Analyzer results are reported along with compiler results.

For more information on the differences between legacy analysis and source analysis, see the following:

To migrate to source analysis, install the FxCop analyzers. Like legacy analysis rule violations, source code analysis violations appear in the Error List window in Visual Studio. In addition, source code analysis violations also show up in the code editor as squiggles under the offending code. The color of the squiggle depends on the severity setting of the rule. To see the status of rules ported to the new FxCop analyzers, see Ported and unported rules.

To learn more about how to configure the FxCop analyzers: