ANcpSdk.AspNetCore.ServiceDefaults.AutoRegister
1.6.13
dotnet add package ANcpSdk.AspNetCore.ServiceDefaults.AutoRegister --version 1.6.13
NuGet\Install-Package ANcpSdk.AspNetCore.ServiceDefaults.AutoRegister -Version 1.6.13
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="ANcpSdk.AspNetCore.ServiceDefaults.AutoRegister" Version="1.6.13" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ANcpSdk.AspNetCore.ServiceDefaults.AutoRegister" Version="1.6.13" />
<PackageReference Include="ANcpSdk.AspNetCore.ServiceDefaults.AutoRegister" />
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 ANcpSdk.AspNetCore.ServiceDefaults.AutoRegister --version 1.6.13
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ANcpSdk.AspNetCore.ServiceDefaults.AutoRegister, 1.6.13"
#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 ANcpSdk.AspNetCore.ServiceDefaults.AutoRegister@1.6.13
#: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=ANcpSdk.AspNetCore.ServiceDefaults.AutoRegister&version=1.6.13
#tool nuget:?package=ANcpSdk.AspNetCore.ServiceDefaults.AutoRegister&version=1.6.13
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ANcpSdk.AspNetCore.ServiceDefaults.AutoRegister
Incremental source generator for ASP.NET Core service defaults and instrumentation.
Overview
This generator provides compile-time interception of:
- Build() calls - Auto-registers service defaults
- GenAI SDK calls - OpenTelemetry spans for AI providers
- Database calls - OpenTelemetry spans for ADO.NET
- [OTel] attributes - Activity.SetTag() extension methods
Generated Files
| File | Purpose |
|---|---|
Intercepts.g.cs |
WebApplicationBuilder.Build() interception |
GenAiIntercepts.g.cs |
GenAI SDK method interceptors |
DbIntercepts.g.cs |
DbCommand.Execute* interceptors |
OTelTagExtensions.g.cs |
SetTagsFrom* extension methods |
Architecture
Models/
├── ProviderRegistry.cs ← SSOT for all provider definitions
├── GenAiInvocationInfo.cs ← GenAI call site data
├── DbInvocationInfo.cs ← Database call site data
├── OTelTagInfo.cs ← [OTel] attribute data
├── InterceptionData.cs ← Build() interception data
└── ProviderInfo.cs ← Detected provider info
Analyzers/
├── ProviderDetector.cs ← Detects providers via assembly references
├── GenAiCallSiteAnalyzer.cs ← Finds GenAI SDK invocations
├── DbCallSiteAnalyzer.cs ← Finds DbCommand invocations
└── OTelTagAnalyzer.cs ← Finds [OTel] attributes
Emitters/
├── GenAiInterceptorEmitter.cs ← Emits GenAI interceptors
├── DbInterceptorEmitter.cs ← Emits DB interceptors
└── OTelTagsEmitter.cs ← Emits SetTag extensions
Supported Providers
GenAI
| Provider | Assembly | Provider ID |
|---|---|---|
| OpenAI | OpenAI |
openai |
| Anthropic | Anthropic.SDK |
anthropic |
| Azure OpenAI | Azure.AI.OpenAI |
azure_openai |
| Ollama | OllamaSharp |
ollama |
| Google AI | Mscc.GenerativeAI |
google_ai |
| Vertex AI | Google.Cloud.AIPlatform.V1 |
vertex_ai |
Database
| Provider | Assembly | Provider ID |
|---|---|---|
| DuckDB | DuckDB.NET.Data |
duckdb |
| SQLite | Microsoft.Data.Sqlite |
sqlite |
| PostgreSQL | Npgsql |
postgresql |
| MySQL | MySqlConnector |
mysql |
| SQL Server | Microsoft.Data.SqlClient |
mssql |
| Oracle | Oracle.ManagedDataAccess |
oracle |
| Firebird | FirebirdSql.Data.FirebirdClient |
firebird |
Adding New Providers
- Add provider definition to
Models/ProviderRegistry.cs - For database providers, also update
DbInstrumentation.MapTypeNameToDbSystem - Run tests to verify detection
Implementation Notes
- Targets
netstandard2.0for Roslyn compatibility - Uses C# interceptors (
[InterceptsLocation]) - Incremental generator with tracking names for debugging
- Provider detection via
Compilation.ReferencedAssemblyNames
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- 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 |
|---|---|---|
| 1.6.13 | 29 | 1/18/2026 |
| 1.6.12 | 29 | 1/18/2026 |
| 1.6.11 | 32 | 1/17/2026 |
| 1.6.10 | 40 | 1/16/2026 |
| 1.6.9 | 38 | 1/15/2026 |
| 1.6.8 | 41 | 1/15/2026 |
| 1.6.7 | 65 | 1/15/2026 |
| 1.6.6 | 70 | 1/14/2026 |
| 1.6.5 | 80 | 1/14/2026 |
| 1.6.4 | 75 | 1/14/2026 |
| 1.6.3 | 93 | 1/13/2026 |
| 1.6.2 | 105 | 1/10/2026 |
| 1.6.1 | 79 | 1/10/2026 |
| 1.6.0 | 84 | 1/9/2026 |
| 1.5.1 | 82 | 1/8/2026 |
| 1.5.0 | 96 | 1/2/2026 |
| 1.4.2 | 94 | 1/1/2026 |
| 1.4.1 | 88 | 1/1/2026 |
| 1.4.0 | 94 | 1/1/2026 |
| 1.3.31 | 77 | 1/9/2026 |
| 1.3.30 | 78 | 1/9/2026 |
| 1.3.29 | 87 | 1/9/2026 |
| 1.3.28 | 81 | 1/9/2026 |
| 1.3.27 | 84 | 1/9/2026 |
| 1.3.26 | 82 | 1/9/2026 |
| 1.3.25 | 81 | 1/9/2026 |
| 1.3.24 | 81 | 1/9/2026 |
| 1.3.23 | 94 | 1/6/2026 |
| 1.3.22 | 95 | 1/6/2026 |
| 1.3.20 | 91 | 1/2/2026 |
| 1.3.19 | 92 | 1/2/2026 |
| 1.3.18 | 94 | 1/1/2026 |
| 1.3.17 | 90 | 1/1/2026 |
| 1.3.16 | 80 | 12/31/2025 |
| 1.3.15 | 81 | 12/31/2025 |
| 1.3.14 | 81 | 12/31/2025 |
| 1.3.13 | 81 | 12/31/2025 |
| 1.3.12 | 81 | 12/31/2025 |
| 1.3.10 | 82 | 12/31/2025 |
| 1.3.8 | 90 | 12/30/2025 |
| 1.3.7 | 81 | 12/30/2025 |
| 1.3.6 | 84 | 12/30/2025 |
| 1.3.5 | 86 | 12/30/2025 |
| 1.3.4 | 85 | 12/30/2025 |
| 1.3.3 | 88 | 12/30/2025 |
| 1.3.2 | 88 | 12/30/2025 |
| 1.3.1 | 78 | 12/30/2025 |
| 1.3.0 | 82 | 12/30/2025 |
| 1.2.4 | 86 | 12/29/2025 |
| 1.2.3 | 83 | 12/29/2025 |
| 1.2.2 | 82 | 12/29/2025 |
| 1.2.1 | 174 | 12/25/2025 |
| 1.2.0 | 169 | 12/24/2025 |
| 1.1.8 | 274 | 12/16/2025 |
| 1.1.7 | 269 | 12/16/2025 |
| 1.0.0 | 295 | 12/15/2025 |