| name | roslynator |
| description | Run C# static analysis, auto-fix code issues, format code, find unused code, and enforce coding standards in .NET projects. Use when the user asks about code quality, linting, static analysis, code cleanup, unused code, or formatting in C# / .NET projects. |
| argument-hint | [solution or project path] |
Prerequisites
Check if roslynator is installed:
which roslynator
If not found, try running via dnx (no install needed, .NET 10+):
dnx Roslynator.DotNet.Cli [command] [options]
Or install globally:
dotnet tool install -g roslynator.dotnet.cli
About Roslynator
Roslynator is a set of code analysis tools for C# powered by Roslyn. It provides 500+ analyzers, refactorings, and code fixes. The CLI tool can analyze, fix, and format entire solutions from the command line — no IDE needed.
The CLI itself contains no analyzers — they come from NuGet packages referenced in your project (e.g. Roslynator.Analyzers) or via --analyzer-assemblies.
Common Usage
Fix all diagnostics in a solution:
roslynator fix MySolution.sln
Fix all diagnostics in a project:
roslynator fix MyProject.csproj
Analyze without fixing (report only):
roslynator analyze MySolution.sln
Format code:
roslynator format MySolution.sln