HsSqlAgent.Hosting
2.0.5
dotnet add package HsSqlAgent.Hosting --version 2.0.5
NuGet\Install-Package HsSqlAgent.Hosting -Version 2.0.5
<PackageReference Include="HsSqlAgent.Hosting" Version="2.0.5" />
<PackageVersion Include="HsSqlAgent.Hosting" Version="2.0.5" />
<PackageReference Include="HsSqlAgent.Hosting" />
paket add HsSqlAgent.Hosting --version 2.0.5
#r "nuget: HsSqlAgent.Hosting, 2.0.5"
#:package HsSqlAgent.Hosting@2.0.5
#addin nuget:?package=HsSqlAgent.Hosting&version=2.0.5
#tool nuget:?package=HsSqlAgent.Hosting&version=2.0.5
HsSqlAgent.Hosting
Official batteries-included ASP.NET Core composition for HsSqlAgent.
Use this package when you want the same capability composition and configuration contract as the first-party ToolBox / Docker image. Use HsSqlAgent.Server directly when you need to replace individual capabilities, authentication, approval providers, UI, or middleware ordering.
Install
dotnet add package HsSqlAgent.Hosting
HsSqlAgent.Hosting brings in the standard HsSqlAgent.Server runtime plus the official generic HsSqlAgent.Approvals.Webhook adapter. It does not add runtime NuGet/DLL plugin loading.
Use
using HsSqlAgent.Hosting;
var builder = WebApplication.CreateBuilder(args);
builder.AddHsSqlAgentStandardHost();
var app = builder.Build();
app.UseHsSqlAgentStandardHost();
await app.RunAsync();
The standard host owns HsSqlAgent's built-in runtime, Admin Store, built-in identity, MCP endpoint, Admin API/UI, telemetry, exception handling, and DML approval provider selection. URL binding and logging remain normal host-owned ASP.NET Core concerns.
DML approval provider
The same configuration works in a .NET host and in the official Docker image.
MCP Elicitation is the default:
{
"DmlApproval": {
"Provider": "McpElicitation"
}
}
To use the official generic Webhook adapter:
{
"DmlApproval": {
"Provider": "Webhook",
"Webhook": {
"Endpoint": "https://approval.example.com/hssqlagent/requests",
"CallbackUrl": "https://sql-agent.example.com/api/hs-sql-agent/approvals/webhook",
"SigningSecret": "replace-with-a-unique-secret-at-least-32-bytes"
}
}
}
Environment variables use normal ASP.NET Core configuration names, for example:
DmlApproval__Provider=Webhook
DmlApproval__Webhook__Endpoint=https://approval.example.com/hssqlagent/requests
DmlApproval__Webhook__CallbackUrl=https://sql-agent.example.com/api/hs-sql-agent/approvals/webhook
DmlApproval__Webhook__SigningSecret=replace-with-a-unique-secret-at-least-32-bytes
Unknown provider names fail at startup. Standard hosting intentionally owns this selector; if you need a custom IDmlApprovalProvider, use the modular HsSqlAgent.Server package instead.
Modular alternative
For an existing ASP.NET Core application that wants to keep its own authentication, authorization, frontend, exception handling, telemetry, or approval composition:
dotnet add package HsSqlAgent.Server
Then opt into only the capabilities you need with the AddHsSqlAgent* modular APIs. Optional integrations such as HsSqlAgent.Approvals.Webhook can be referenced separately.
This split keeps the library surface composable while giving Docker and batteries-included NuGet users one shared first-party composition.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- BCrypt.Net-Next (>= 4.0.3)
- dapper (>= 2.1.79)
- FirebirdSql.Data.FirebirdClient (>= 10.3.4)
- FluentValidation.AspNetCore (>= 11.3.1)
- FSharp.Core (>= 10.1.201)
- HsSqlAgent.Approvals.Webhook (>= 2.0.5)
- HsSqlAgent.Server (>= 2.0.5)
- Humanizer.Core (>= 3.0.10)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.9)
- Microsoft.AspNetCore.Authentication.OpenIdConnect (>= 10.0.9)
- Microsoft.Data.SqlClient (>= 7.0.2)
- Microsoft.Data.Sqlite (>= 10.0.9)
- Microsoft.EntityFrameworkCore (>= 10.0.9)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.9)
- Microsoft.EntityFrameworkCore.Sqlite (>= 10.0.9)
- Microsoft.Extensions.Caching.StackExchangeRedis (>= 10.0.9)
- Microsoft.Extensions.FileProviders.Embedded (>= 10.0.9)
- ModelContextProtocol (>= 1.4.0)
- ModelContextProtocol.AspNetCore (>= 1.4.0)
- MySql.Data (>= 9.7.0)
- Npgsql (>= 10.0.3)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 10.0.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.17.0)
- OpenTelemetry.Exporter.Prometheus.HttpListener (>= 1.17.0-beta.1)
- OpenTelemetry.Extensions.Hosting (>= 1.17.0)
- Oracle.ManagedDataAccess.Core (>= 23.26.200)
- SQLitePCLRaw.lib.e_sqlite3 (>= 3.50.3)
- StackExchange.Redis (>= 2.7.27)
- System.IdentityModel.Tokens.Jwt (>= 8.19.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.