Roslyn the new open source compiler for C# and Visual Basic introduced the possibility to add new warnings and errors to the build via Analyzers.
Visual Studio 2015 or Visual Studio Code present them visually and also allow Code Fixes: Automated actions to fix a specific warning or error.
While analyzers can be installed from the Visual Studio extension gallery, for them to be used in command line builds and shared by all developers they must be installed as NuGet packages for each project.
Each package can either contain only analyzers or analyzers along with other files, allowing a library to include automated migration from now-Obsolete constructs or warnings on incorrect usage.
When a NuGet package containing analyzers is added to a
file, the analyzers will be installed in the corresponding projects automatically by Paket.
Analyzers are only supported by roslyn based compilers, in other versions the nodes added by Paket will be ignored.
Analyzers created by the "Analyzer with Code Fix" template are currently installed via
Install.ps1 in Visual Studio
that Paket doesn't plan support (See the FAQ for more details)
For them to work in Paket they need to be placed in specific folders inside the NuGet package.
The structure look like :
1: 2: 3: 4: 5: 6: 7:
The general structure is :
This structure is already the one generated by the "Analyzer with Code Fix" template and conform to the
documented convention for analyzers to be installed by NuGet
project.json based projects.
If the language is absent from the path the analyzer will be installed in any supported project type
.fsproj) if it is present the analyzer will only be installed in the corresponding
project type :
- There is currently no way to create analyzers for F#.
dotnetpart of the path is in fact the host platform that is targeted. The only one currently in existence is the Roslyn compiler and it require the
- The Roslyn developers maintains some analyzers under the roslyn-analyzers project but others have started to appear like Refactoring Essentials or Code Cracker.