In this section, we will write a C# console application based on Roslyn Compiler APIs that loads the given analyzer assembly, executes all diagnostic analyzers defined in this assembly on a given source file, and outputs all the reported analyzer diagnostics.
Writing an application based on the Compiler Analyzer API to execute diagnostic analyzers and display analyzer diagnostics
Getting started
You will need to have the Visual Studio 2017 Community Edition installed on your machine to execute this recipe. You can install a free Community Edition from https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15.