I am using both ReSharper and StyleCop extentions on VS 2019 and I have some question.
I would recommend not using either the ReSharper or Visual Studio extensions for StyleCop. The preferred way of using static code analysis (especially for .net 5 onwards) is to use the NuGet packages. There are several you can try:
These can all be configured using the .editorconfig
file. All their rules will be under Project
->Dependancies
->Analyzers
in Visual Studio's Solution Explorer where you can set their severity.
The advantage of using the NuGet packages is that you can apply them to just the projects you want. As they are now part of your build then they will run on a build server and can be configured to fail the build if rules aren't adhered to.
The ReSharper and Visual Studio extensions only apply to the individual user who has them installed (each possibly having their own rules).
You can create a global .editorconfig
file to apply to all of your projects. This works in the same way as the older Settings.StyleCop
file where it would search up your folder branch till it found the file.
Lots of Microsoft Docs:
You may also find that the ReSharper and/or Visual Studio extensions may no longer be supported and may not work as expected with later versions of .net/C#.