Soenneker.Extensions.ServiceCollection
4.0.295
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Extensions.ServiceCollection --version 4.0.295
NuGet\Install-Package Soenneker.Extensions.ServiceCollection -Version 4.0.295
<PackageReference Include="Soenneker.Extensions.ServiceCollection" Version="4.0.295" />
<PackageVersion Include="Soenneker.Extensions.ServiceCollection" Version="4.0.295" />
<PackageReference Include="Soenneker.Extensions.ServiceCollection" />
paket add Soenneker.Extensions.ServiceCollection --version 4.0.295
#r "nuget: Soenneker.Extensions.ServiceCollection, 4.0.295"
#:package Soenneker.Extensions.ServiceCollection@4.0.295
#addin nuget:?package=Soenneker.Extensions.ServiceCollection&version=4.0.295
#tool nuget:?package=Soenneker.Extensions.ServiceCollection&version=4.0.295
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 | 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
- Asp.Versioning.Mvc (>= 10.2.1)
- Serilog (>= 4.4.0)
- Soenneker.Extensions.String (>= 4.0.791)
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 |
|---|---|---|
| 4.0.297 | 348 | 10/15/2026 |
| 4.0.296 | 84 | 10/15/2026 |
| 4.0.295 | 85 | 10/14/2026 |
| 4.0.293 | 88 | 10/14/2026 |
| 4.0.292 | 83 | 10/14/2026 |
| 4.0.286 | 83 | 10/13/2026 |
| 4.0.285 | 80 | 10/12/2026 |
| 4.0.281 | 93 | 10/11/2026 |
| 4.0.280 | 84 | 10/11/2026 |
| 4.0.279 | 87 | 10/11/2026 |
| 4.0.278 | 95 | 10/11/2026 |
| 4.0.277 | 320 | 9/30/2026 |
| 4.0.276 | 134 | 9/26/2026 |
| 4.0.275 | 103 | 9/25/2026 |
| 4.0.274 | 103 | 9/25/2026 |
| 4.0.273 | 106 | 9/24/2026 |
| 4.0.272 | 277 | 9/16/2026 |
| 4.0.271 | 106 | 9/16/2026 |
| 4.0.270 | 98 | 9/15/2026 |
| 4.0.269 | 100 | 9/15/2026 |
Updated Multiple NuGet packages