Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly install StyleCop for Visual Studio 2017 Community?

Well i downloaded the newest version, then installed, checked to instal entire files on local drive. I restarted Visual Studio 2017 Community and rerun it. Unfortunatelly i can't find in menu > tools anything with should be connected with stylecop ( as in tutorial "how to use stylecop"). I am using x64 Windows7. I really really don't know how to to use it.

like image 296
RFE Petr Avatar asked Sep 06 '17 13:09

RFE Petr


People also ask

How do I add StyleCop?

The easiest way to add a stylecop. json configuration file to a new project is using a code fix provided by the project. To invoke the code fix, open any file where SA1633 is reported¹ and press Ctrl+. to bring up the Quick Fix menu. From the menu, select Add StyleCop settings file to the project.

How do you integrate StyleCop in Visual Studio 2019?

Go to project references, find analyzers, right click on it and select Open Active Rule Set, then you can disable\enable rules if styleCop is installed.

Is StyleCop free?

StyleCop is a free source code analysis tool for C# developers that was initially developed by Microsoft.


2 Answers

Go to extensions and updates and search for stylecop in the online area.

Choose the one by Chris Dahlberg.

Close VS and it will install.

open your project up and make sure you have a settings.stylecop file in there.

right click on the project in the solution explorer and you will see a run stylecop option

like image 137
user3191912 Avatar answered Oct 07 '22 19:10

user3191912


After reading a comment from the extension creator, it appears that future development is targeted for the SytleCopAnalyzers NuGet package. Using VS 2017, this was easy to get running. Instructions here -> https://github.com/DotNetAnalyzers/StyleCopAnalyzers.

like image 37
Andrew Borst Avatar answered Oct 07 '22 18:10

Andrew Borst