Snaglist.Analyzers 0.1.0

dotnet add package Snaglist.Analyzers --version 0.1.0
                    
NuGet\Install-Package Snaglist.Analyzers -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Snaglist.Analyzers" Version="0.1.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Snaglist.Analyzers" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Snaglist.Analyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Snaglist.Analyzers --version 0.1.0
                    
#r "nuget: Snaglist.Analyzers, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Snaglist.Analyzers@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Snaglist.Analyzers&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Snaglist.Analyzers&version=0.1.0
                    
Install as a Cake Tool

Snaglist.Analyzers

Roslyn analyzers and code fixes for .NET service mistakes that compile fine and fail at runtime. A snag list is the builder's defect checklist; this is one for your codebase.

dotnet add package Snaglist.Analyzers

Rules

ID What it catches
DAP001 SQL references @param but the parameter object has no matching member
DAP002 Parameter object member the SQL never references (Dapper drops it silently)
DAP003 SQL assembled at runtime (interpolation, concatenation, string.Format)
DAP004 Async Dapper call ignoring an available CancellationToken
DAP005 No commandTimeout set (off by default; opt in per project)
DAP006 SELECT * mapped to a typed result
DAP007 Selected column has no matching writable member on the result type
DAP008 Synchronous Dapper call inside an async method
DAP009 splitOn column absent from the projection
DAP010 UPDATE/DELETE without a WHERE clause
DAP011 Available transaction not passed (code fix: pass it)
DAP012 Duplicate selected column name
DAP013 TOP without ORDER BY
ASYNC001 .Result / .Wait() / GetResult() on a task
ASYNC002 Task.Run result not observed
ASYNC003 Async work wrapped in Task.Run
ASYNC004 Available CancellationToken not forwarded (code fix: pass it)
ASYNC005 OperationCanceledException swallowed (code fix: rethrow)
ASYNC006 Public async I/O method has no CancellationToken parameter
SER001 Exception passed as a Serilog template property - stack trace lost (code fix)
SER002 Interpolated or concatenated message template (code fix: convert to template)
SER003 Placeholder count doesn't match argument count
SER004 Catch block logs without the caught exception
CFG001 Configuration key not defined in any appsettings*.json of the project
WEB001 Route {token} with no matching action parameter
WEB002 Static state on a controller
WEB003 Two actions on the same verb + route
AUTH001 [ApiController] action with neither an authorization attribute nor [AllowAnonymous]
TIME001 DateTime.Now in a class that has an injected clock
DI001 Singleton whose constructor takes a scoped service
JSON001 Type mixes Newtonsoft and System.Text.Json attributes
JSON002 Attribute for a JSON serializer the project never uses

AUTH001 counts any attribute deriving from AuthorizeAttribute or implementing IAuthorizeData as coverage, so custom auth attributes work without configuration. CFG001 needs your appsettings*.json files exposed to analyzers as AdditionalFiles.

Configuration

Silence a whole family via any global analyzer config (is_global = true):

snaglist.dapper.enabled = false

Adjust individual rule severity anywhere .editorconfig reaches:

[*.cs]
dotnet_diagnostic.DAP005.severity = warning
dotnet_diagnostic.AUTH001.severity = error
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 43 8/26/2026