ServiceResolver.GenericHost.SimpleInjector
3.6.2
See the version list below for details.
dotnet add package ServiceResolver.GenericHost.SimpleInjector --version 3.6.2
NuGet\Install-Package ServiceResolver.GenericHost.SimpleInjector -Version 3.6.2
<PackageReference Include="ServiceResolver.GenericHost.SimpleInjector" Version="3.6.2" />
<PackageVersion Include="ServiceResolver.GenericHost.SimpleInjector" Version="3.6.2" />
<PackageReference Include="ServiceResolver.GenericHost.SimpleInjector" />
paket add ServiceResolver.GenericHost.SimpleInjector --version 3.6.2
#r "nuget: ServiceResolver.GenericHost.SimpleInjector, 3.6.2"
#:package ServiceResolver.GenericHost.SimpleInjector@3.6.2
#addin nuget:?package=ServiceResolver.GenericHost.SimpleInjector&version=3.6.2
#tool nuget:?package=ServiceResolver.GenericHost.SimpleInjector&version=3.6.2
ServiceResolver.GenericHost.SimpleInjector wires ServiceResolver.Ioc.SimpleInjector into Microsoft.Extensions.Hosting's IHostBuilder, replacing the default IServiceProvider with a SimpleInjector-backed one.
Getting started (console / worker apps)
var hostBuilder = Host.CreateDefaultBuilder(args)
.UseServiceResolver(new SimpleInjectorOptions
{
OnRegistering = provider =>
{
provider.Register<StringBuilder>(() => new StringBuilder("hello world.."));
},
AfterBuildingProvider = provider =>
{
provider.Verify();
}
});
var host = hostBuilder.Build();
await host.RunAsync();
An overload taking Func<HostBuilderContext, SimpleInjectorOptions> is also available when you need access to configuration or environment during setup.
Getting started (ASP.NET Core, .NET 6+)
Also requires the ServiceResolver.GenericHost.AspNetCore package.
var builder = WebApplication.CreateBuilder(args);
builder.Host.UseServiceResolver(new SimpleInjectorOptions
{
BeforeRegistering = collection =>
{
collection.AddControllers();
},
OnRegistering = serviceRegister =>
{
serviceRegister
.AddAspNetCore()
.AddControllerActivation();
},
AfterBuildingProvider = provider =>
{
provider.Verify();
}
});
var app = builder.Build();
app.UseAuthorization();
app.MapControllers();
await app.RunAsync();
Constructor resolution: strict by default, relaxed where it has to be
By default (ConstructorResolutionType = ResolutionType.Hybrid), services registered through IServiceRegister keep SimpleInjector's strict rules (single public constructor, no optional-parameter fallback), while services coming from IServiceCollection (ASP.NET Core, third-party AddXxx() extensions) get a more permissive resolution — because those libraries routinely assume Microsoft's own, more lenient DI conventions. Set ConstructorResolutionType / SuppressDiagnosticType to ResolutionType.Standard (fully strict) or ResolutionType.LessRestrictive (relaxed everywhere) to change this globally.
Main types
SimpleInjectorOptions— the configuration passed toUseServiceResolver.
Advanced scenarios that configure the underlying Container directly can use the public types under the ServiceResolver.Ioc.Advanced namespace, such as KeyedConstructorResolverBehavior and KeyedDependencyInjectionBehavior — see the documentation for details.
Related packages
ServiceResolver.GenericHostServiceResolver.Ioc.SimpleInjectorServiceResolver.GenericHost.AspNetCore(for ASP.NET Core)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- ServiceResolver.GenericHost (>= 3.6.2)
- ServiceResolver.Ioc.SimpleInjector (>= 2.9.2)
-
net10.0
- ServiceResolver.GenericHost (>= 3.6.2)
- ServiceResolver.Ioc.SimpleInjector (>= 2.9.2)
-
net6.0
- ServiceResolver.GenericHost (>= 3.6.2)
- ServiceResolver.Ioc.SimpleInjector (>= 2.9.2)
-
net8.0
- ServiceResolver.GenericHost (>= 3.6.2)
- ServiceResolver.Ioc.SimpleInjector (>= 2.9.2)
-
net9.0
- ServiceResolver.GenericHost (>= 3.6.2)
- ServiceResolver.Ioc.SimpleInjector (>= 2.9.2)
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 |
|---|---|---|
| 3.6.4 | 0 | 8/21/2026 |
| 3.6.3 | 40 | 8/20/2026 |
| 3.6.2 | 37 | 8/20/2026 |
| 3.6.1 | 2,138 | 12/1/2025 |
| 3.5.2 | 712 | 8/6/2025 |
| 3.5.1 | 150 | 8/3/2025 |
| 3.4.2 | 412 | 6/24/2025 |
| 3.4.1 | 1,590 | 3/4/2025 |
| 3.4.1-rc2 | 185 | 2/27/2025 |
| 3.4.1-rc1 | 171 | 2/27/2025 |
| 3.3.3 | 293 | 2/11/2025 |
| 3.3.2 | 424 | 11/25/2024 |
| 3.3.1 | 540 | 10/10/2024 |
| 3.2.1 | 271 | 9/10/2024 |
| 3.1.1 | 267 | 9/9/2024 |
| 2.2.1 | 1,032 | 4/5/2024 |
| 2.1.1 | 378 | 2/28/2024 |
| 1.1.1 | 237 | 2/8/2024 |
| 1.0.1 | 215 | 1/26/2024 |