Soenneker.Extensions.ServiceCollection
11.0.316
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Extensions.ServiceCollection --version 11.0.316
NuGet\Install-Package Soenneker.Extensions.ServiceCollection -Version 11.0.316
<PackageReference Include="Soenneker.Extensions.ServiceCollection" Version="11.0.316" />
<PackageVersion Include="Soenneker.Extensions.ServiceCollection" Version="11.0.316" />
<PackageReference Include="Soenneker.Extensions.ServiceCollection" />
paket add Soenneker.Extensions.ServiceCollection --version 11.0.316
#r "nuget: Soenneker.Extensions.ServiceCollection, 11.0.316"
#:package Soenneker.Extensions.ServiceCollection@11.0.316
#addin nuget:?package=Soenneker.Extensions.ServiceCollection&version=11.0.316
#tool nuget:?package=Soenneker.Extensions.ServiceCollection&version=11.0.316
Soenneker.Extensions.ServiceCollection
Opinionated ASP.NET Core registration for JSON controllers, CORS, header API versioning, and Azure ARR client-certificate forwarding.
Installation
dotnet add package Soenneker.Extensions.ServiceCollection
Controller JSON options
using Soenneker.Extensions.ServiceCollection;
services.AddControllersWithDefaultJsonOptions();
This registers MVC controllers and configures System.Text.Json to omit null properties when writing responses. It does not change null handling during deserialization.
CORS policy
{
"CorsPolicy": {
"Origins": "https://app.example.com;https://admin.example.com",
"Methods": "GET,POST,PUT,DELETE"
}
}
services.AddDefaultCorsPolicy(configuration);
// Later in the request pipeline:
app.UseCors();
Origins are semicolon-separated; methods are comma-separated. Entries are trimmed and blanks are removed. Missing/empty origins or methods throw InvalidOperationException when the policy is built rather than opening access silently. Set either value to the single entry * only when unrestricted origins or methods are intentional.
The policy always allows any request header. Passing signalR: true enables credentials and therefore requires explicit origins; * is rejected. CORS is a browser access policy, not authentication or authorization.
Header API versioning
services.ConfigureVersioning();
This registers API versioning with version 1.0 as the default, reads the requested version from the api-version header, and assumes the default when the header is absent. It does not add URL-segment or query-string version readers and does not report supported versions in response headers.
Azure ARR certificate forwarding
services.AddArrClientCertForwarding();
// Before authentication/authorization:
app.UseCertificateForwarding();
The default header is X-ARR-ClientCert; pass another name when the trusted proxy uses a different header. The value must be a base64-encoded DER certificate. Blank, malformed, or empty values produce no certificate; invalid certificate bytes can throw during certificate loading.
Certificate headers are spoofable when accepted directly from clients. Use this only behind a trusted proxy that removes incoming copies of the header and writes its own verified value. Certificate forwarding parses a certificate; it does not establish trust, validate a chain, or authenticate the request by itself.
All methods register services only. The corresponding middleware and endpoint mapping remain the application's responsibility.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Asp.Versioning.Mvc (>= 10.2.1)
- Serilog (>= 4.4.1)
- Soenneker.Extensions.String (>= 11.0.826)
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 |
|---|---|---|
| 11.0.321 | 33 | 12/1/2026 |
| 11.0.320 | 39 | 12/1/2026 |
| 11.0.319 | 46 | 12/1/2026 |
| 11.0.318 | 43 | 12/1/2026 |
| 11.0.317 | 41 | 12/1/2026 |
| 11.0.316 | 67 | 11/29/2026 |
| 11.0.315 | 62 | 11/29/2026 |
| 11.0.314 | 203 | 11/18/2026 |
| 11.0.313 | 97 | 11/18/2026 |
| 11.0.311 | 120 | 11/15/2026 |
| 11.0.310 | 170 | 11/11/2026 |
| 11.0.309 | 98 | 11/11/2026 |
| 11.0.308 | 111 | 11/11/2026 |
| 11.0.307 | 91 | 11/11/2026 |
| 11.0.306 | 96 | 11/11/2026 |
| 11.0.305 | 109 | 11/11/2026 |
| 11.0.304 | 93 | 11/10/2026 |
| 11.0.303 | 238 | 11/3/2026 |
| 11.0.302 | 106 | 11/3/2026 |
| 11.0.301 | 104 | 11/2/2026 |
Updated Multiple NuGet packages