Roslyn analyzers for ASP.NET.Core.
Id | Title |
---|---|
ASP001 | Parameter name does not match the name specified by the route parameter |
ASP002 | Route parameter name does not match the method parameter name |
ASP003 | Parameter type does not match the type specified by the name specified by the route parameter |
ASP004 | Route parameter type does not match the method parameter type |
ASP005 | Syntax error in parameter |
ASP006 | Escape constraint regex |
ASP007 | The method has no corresponding parameter |
ASP008 | Invalid route parameter name |
ASP009 | Use kebab-cased urls |
ASP010 | Unexpected character in url |
ASP011 | Route parameter appears more than once |
ASP012 | Don't use [controller] |
ASP013 | Name the controller to match the route |
The preferable way to use the analyzers is to add the nuget package AspNetCoreAnalyzers to the project(s).
The severity of individual rules may be configured using .ruleset files in Visual Studio.
AspNetCoreAnalyzers can be installed using Paket or the NuGet command line or the NuGet Package Manager in Visual Studio.
Install using the command line:
Install-Package AspNetCoreAnalyzers
The ruleset editor does not handle changes IDs well, if things get out of sync you can try:
- Close visual studio.
- Edit the ProjectName.rulset file and remove the AspNetCoreAnalyzers element.
- Start visual studio and add back the desired configuration.
Above is not ideal, sorry about this. Not sure if this is our bug.
Early alpha, names and IDs may change.