Soenneker.Extensions.ServiceCollection 11.0.298

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.ServiceCollection --version 11.0.298
                    
NuGet\Install-Package Soenneker.Extensions.ServiceCollection -Version 11.0.298
                    
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="11.0.298" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.ServiceCollection" Version="11.0.298" />
                    
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 11.0.298
                    
#r "nuget: Soenneker.Extensions.ServiceCollection, 11.0.298"
                    
#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@11.0.298
                    
#: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=11.0.298
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.ServiceCollection&version=11.0.298
                    
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 net11.0 is compatible. 
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
11.0.314 200 11/18/2026
11.0.313 94 11/18/2026
11.0.311 118 11/15/2026
11.0.310 169 11/11/2026
11.0.309 96 11/11/2026
11.0.308 108 11/11/2026
11.0.307 90 11/11/2026
11.0.306 95 11/11/2026
11.0.305 106 11/11/2026
11.0.304 92 11/10/2026
11.0.303 237 11/3/2026
11.0.302 104 11/3/2026
11.0.301 103 11/2/2026
11.0.300 139 10/27/2026
11.0.299 110 10/26/2026
11.0.298 107 10/26/2026
4.0.297 637 10/15/2026
4.0.296 105 10/15/2026
4.0.295 104 10/14/2026
4.0.293 113 10/14/2026
Loading failed

Migrate to .NET 11 and version 11