Use StyleCop


Hello! I have some questions:

1. Is is possible to use StyleCop.Analyzers is Unity Rider project? Or unity project is not .NET core project?

2. Where should i put Settings.StyleCop file to override standart rules? And how can i apply this rule to format code?

1 comment
Comment actions Permalink


1. Yes, it is possible to add Roslyn analyzers to a Unity project. However, it is not super easy, as Unity regenerates csproj files, and reference to Analyzer will be lost if you add it there. Please check out this how-to for a workaround

2. StyleCop.Analyzers package doesn't support Setting.StyleCop. You can use a .ruleset file instead. Put it hear the dll with analyzers as suggested in the workaround.


Please sign in to leave a comment.