Visual Studio 2015 - What does the "Analyzers" reference mean?

C#ReferenceVisual Studio-2015

C# Problem Overview


Creating a plain C# Console App in Visual Studio 2015 Preview, we get a pseudo reference named "Analyzers":


Expanded Solution Explorer project

What does the "Analyzers" reference just above mean?

The project file has nothing inside and the properties window shows nothing (completely blank) about this entry (though, in contrast to "reference properties" it says "folder properties" in the header, but that does not say much).

I would expect this to be related to Roslyn, but I have no idea. I have ReSharper installed, but I don't assume it has anything to do with it.

Edit 6.8.2016

The accepted answer explains the tooling provided by analyzers, but leaves open why a development tool becomes a (runtime?) reference. Actually it is not a runtime reference, unlike the other references. So the answer to this miracle is Hans Passants comment below:

> They picked a clumsy place to add the code analyzers feature, they just couldn't find a better place without drastically overhauling the solution explorer and nuget. – Hans Passant May 26 '15 at 8:59

C# Solutions


Solution 1 - C#

Live Code Analyzers are used to add custom error messages and warnings that appear live as you're typing, along with automatic code fixes to help you clean them up. They are available as NuGet packages that you add to your projects in Visual Studio 2015.

It is one of the best and helpful key new features of Visual Studio 2015 that lets a NuGet package enable custom warnings and errors in the editor live as you type the code, with automatic code fixes that can clean up those issues for us.

Packages can even be bundled together as a “code-aware library” that pulls in both an API and the domain-specific analyzers to make sure that you stay on course when using it.

We'll have a targeted guidance from the moment we download the NuGet package. And because these analyzers are part of our project, everyone on your team gets to see the same warnings.

Edit 1 :

Analyzers have rules attached to them like below :

enter image description here

> These rules focus on the most critical problems in your code, > including potential security holes, application crashes, and other > important logic and design errors. You should include this rule set in > any custom rule set you create for your projects.

Solution 2 - C#

Currently there are a number of good Analyzers available – Microsoft.AnalyzerPowerPack, Code Cracker, CSharp Essentials, SonarLint etc

Each of these analyzers have their own rule set, so we can decide which analyzer to add, based on our requirements. Once installed via Nuget, the light bulbs and quick actions in VS2015 will pick up the associated rule set and provide the developers with coding assistance on the fly.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestioncitykidView Question on Stackoverflow
Solution 1 - C#TharifView Answer on Stackoverflow
Solution 2 - C#SammyView Answer on Stackoverflow