Skip to content

Latest commit

 

History

History
105 lines (92 loc) · 5.73 KB

list-of-diagnostics.md

File metadata and controls

105 lines (92 loc) · 5.73 KB

List of Diagnostics Produced by ASP.NET Libraries APIs

Analyzer Warnings

ASP (ASP0000-ASP0024)

Diagnostic ID Description
ASP0000 Do not call 'IServiceCollection.BuildServiceProvider' in 'ConfigureServices'
ASP0001 Authorization middleware is incorrectly configured
ASP0003 Do not use model binding attributes with route handlers
ASP0004 Do not use action results with route handlers
ASP0005 Do not place attribute on method called by route handler lambda
ASP0006 Do not use non-literal sequence numbers
ASP0007 Route parameter and argument optionality is mismatched
ASP0008 Do not use ConfigureWebHost with WebApplicationBuilder.Host
ASP0009 Do not use Configure with WebApplicationBuilder.WebHost
ASP0010 Do not use UseStartup with WebApplicationBuilder.WebHost
ASP0011 Suggest using builder.Logging over Host.ConfigureLogging or WebHost.ConfigureLogging
ASP0012 Suggest using builder.Services over Host.ConfigureServices or WebHost.ConfigureServices
ASP0013 Suggest switching from using Configure methods to WebApplicationBuilder.Configuration
ASP0014 Suggest using top level route registrations
ASP0015 Suggest using IHeaderDictionary properties
ASP0016 Do not return a value from RequestDelegate
ASP0017 Invalid route pattern
ASP0018 Unused route parameter
ASP0019 Suggest using IHeaderDictionary.Append or the indexer
ASP0020 Complex types referenced by route parameters must be parsable
ASP0021 When implementing BindAsync(...) method, the return type must be ValueTask<T>
ASP0022 Route conflict detected between route handlers
ASP0023 Route conflict detected between controller actions
ASP0024 Route handler has multiple parameters with the [FromBody] attribute

API (API1000-API1003)

Diagnostic ID Description
API1000 Action returns undeclared status code
API1001 Action returns undeclared success result
API1002 Action documents status code that is not returned
API1003 Action methods on ApiController instances do not require explicit model validation check

MVC (MVC1000 - MVC1006)

Diagnostic ID Description
MVC1000 Use of IHtmlHelper.{0} should be avoided
MVC1001 Filters cannot be applied to page handler methods
MVC1002 Route attributes cannot be applied to page handler methods
MVC1003 Route attributes cannot be applied to page models
MVC1004 Rename model bound parameter
MVC1005 Cannot use UseMvc with Endpoint Routing
MVC1006 Methods containing TagHelpers must be async and return Task

BL (BL0001-BL0007)

Diagnostic ID Description
BL0001 Component parameter should have public setters
BL0002 Component has multiple CaptureUnmatchedValues parameters
BL0003 Component parameter with CaptureUnmatchedValues has the wrong type
BL0004 Component parameter should be public
BL0005 Component parameter should not be set outside of its component
BL0006 Do not use RenderTree types
BL0007 Component parameters should be auto properties

Request Delegate Generator (RDG001-RDG004)

Diagnostic ID Description
RDG001 Unable to resolve route pattern
RDG002 Unable to resolve endpoint handler
RDG003 Unable to resolve parameter
RDG004 Unable to resolve anonymous type
RDG005 Invalid abstract type
RDG006 Invalid constructor parameters
RDG007 No valid constructor found
RDG008 Multiple public constructors found
RDG009 Invalid nested AsParameters
RDG010 Unexpected nullable type

SignalR Source Generator (SSG0000-SSG0110)

Diagnostic ID Description
SSG0000 Non-interface generic type argument
SSG0001 Unsupported return type
SSG0002 Too many HubServerProxy attributed methods
SSG0003 HubServerProxy attributed method has bad accessibility
SSG0004 HubServerProxy attributed method is not partial
SSG0005 HubServerProxy attributed method is not an extension method
SSG0006 HubServerProxy attributed method has bad number of type arguments
SSG0007 HubServerProxy attributed method type argument and return type does not match
SSG0008 HubServerProxy attributed method has bad number of arguments
SSG0009 HubServerProxy attributed method has argument of wrong type
SSG0100 Unsupported return type
SSG0102 Too many HubClientProxy attributed methods
SSG0103 HubClientProxy attributed method has bad accessibility
SSG0104 HubClientProxy attributed method is not partial
SSG0105 HubClientProxy attributed method is not an extension method
SSG0106 HubClientProxy attributed method has bad number of type arguments
SSG0107 HubClientProxy attributed method type argument and return type does not match
SSG0108 HubClientProxy attributed method has bad number of arguments
SSG0109 HubClientProxy attributed method has first argument of wrong type
SSG0110 HubClientProxy attributed method has wrong return type