Soenneker.Extensions.ServiceProvider 4.0.333

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

Extension methods for resolving and validating services through IServiceProvider, with diagnostics suited to application and integration-test setup.

Installation

dotnet add package Soenneker.Extensions.ServiceProvider

Usage

using Soenneker.Extensions.ServiceProvider;

IMyService service = serviceProvider.Get<IMyService>();

Get<T>() returns the registered instance when it is assignable to T. A missing or incompatible registration throws InvalidOperationException with checks for service registration, test collections, fixtures, startup types, and factories. A null provider throws ArgumentNullException.

This is similar to GetRequiredService<T>(), but its error text is specifically useful in Soenneker integration tests.

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 (3)

Showing the top 3 NuGet packages that depend on Soenneker.Extensions.ServiceProvider:

Package Downloads
Soenneker.Tests.FixturedUnit

A fundamental xUnit test that stores UnitFixture and provides synthetic inversion of control

Soenneker.Tests.HostedUnit

A fundamental test that stores the TestHost and provides synthetic inversion of control

Soenneker.Tests.Integration

An abstract xUnit test class for end-to-end integration (involving WebApplicationFactory) tests

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.333 2,658 8/29/2026
4.0.331 130 8/29/2026
4.0.330 62,267 8/12/2026
4.0.329 76,071 7/27/2026
4.0.328 66,897 7/16/2026
4.0.327 18,378 7/15/2026
4.0.326 69,900 6/18/2026
4.0.325 48,745 6/9/2026
4.0.324 34,849 6/5/2026
4.0.323 59,054 5/12/2026
4.0.322 59,111 4/22/2026
4.0.321 21,146 4/21/2026
4.0.320 20,165 4/14/2026
4.0.319 41,105 3/12/2026
4.0.318 163 3/12/2026
4.0.317 154 3/12/2026
4.0.315 202 3/12/2026
4.0.314 30,611 3/11/2026
4.0.313 130 3/10/2026
4.0.312 9,681 3/9/2026
Loading failed

Describe extension library scope separately from current API