I want to integrate my instance of VS 2015 RC with StyleCop in the way that I have StyleCop menu options [Run StyleCop, Run StyleCop (Rescan All), StyleCop Settings] available when right clicking on project in Solution Explorer. Installing StyleCop-4.7.49.0.msi from official StyleCop site adds proper options for VS 2013 but not for 2015. Is it possible to achieve that?
StyleCop used to be a Visual Studio plugin and a NuGet package. You can still use this in Visual Studio 2019, but the current recommended way to use StyleCop is to use the Roslyn-based analyzers.
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.
If it can help you, I have created a fork of StyleCop from CodePlex. My version works now with VS2015 and support most of new C# 6 specifications. Like version 4.7.49.0, you can right click on your project and you can find "Run StyleCop, Run StyleCop (Rescan All) or Edit settings" menus.
How to install it :
If you have any issue you can report it on GitHub, project name : Visual StyleCop.
Installed VS2015 Community release recently. Since StyleCop project does not list 2015 as supported I digged further.
And found solution. It is StyleCopAnalyzers that can be installed via nuget (make sure that you click "include prerelease" checkbox) on per project basis. This is interesting solution and I like how it looks.
Downside is that it is not possible to just use old Settings.StyleCop and it took me some searching how to configure rules. And I found this blog post. Basically you expand your references list. Then right click on the Analyzers create ruleset and you have .ruleset file in the project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With