Soenneker.Extensions.ServiceCollection 4.0.297

Prefix Reserved
dotnet add package Soenneker.Extensions.ServiceCollection --version 4.0.297
                    
NuGet\Install-Package Soenneker.Extensions.ServiceCollection -Version 4.0.297
                    
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="Soenneker.Extensions.ServiceCollection" Version="4.0.297" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.ServiceCollection" Version="4.0.297" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.ServiceCollection" />
                    
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 Soenneker.Extensions.ServiceCollection --version 4.0.297
                    
#r "nuget: Soenneker.Extensions.ServiceCollection, 4.0.297"
                    
#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 Soenneker.Extensions.ServiceCollection@4.0.297
                    
#: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=Soenneker.Extensions.ServiceCollection&version=4.0.297
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.ServiceCollection&version=4.0.297
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed

Update dependency Soenneker.Extensions.String to 4.0.799 (#715)