ServiceResolver.GenericHost.AspNetCore
3.8.0
dotnet add package ServiceResolver.GenericHost.AspNetCore --version 3.8.0
NuGet\Install-Package ServiceResolver.GenericHost.AspNetCore -Version 3.8.0
<PackageReference Include="ServiceResolver.GenericHost.AspNetCore" Version="3.8.0" />
<PackageVersion Include="ServiceResolver.GenericHost.AspNetCore" Version="3.8.0" />
<PackageReference Include="ServiceResolver.GenericHost.AspNetCore" />
paket add ServiceResolver.GenericHost.AspNetCore --version 3.8.0
#r "nuget: ServiceResolver.GenericHost.AspNetCore, 3.8.0"
#:package ServiceResolver.GenericHost.AspNetCore@3.8.0
#addin nuget:?package=ServiceResolver.GenericHost.AspNetCore&version=3.8.0
#tool nuget:?package=ServiceResolver.GenericHost.AspNetCore&version=3.8.0
ServiceResolver.GenericHost.AspNetCore is an optional add-on for ASP.NET Core apps already using ServiceResolver.GenericHost (e.g. via ServiceResolver.GenericHost.SimpleInjector's UseServiceResolver).
You don't need this package for basic ASP.NET Core support: once UseServiceResolver has replaced the app's IServiceProvider, ASP.NET Core's own default IHttpContextFactory already opens a per-request scope against it, and its default IControllerActivator already constructs controllers (and resolves their scoped dependencies) through HttpContext.RequestServices - that same per-request scope. Install this package only if you want controllers built by the native container instead.
Usage
From your OnRegistering callback:
serviceRegister.AddControllerActivation();
AddControllerActivation() discovers and registers all MVC controllers, and replaces the default IControllerActivator so controllers are constructed (and disposed) by your provider instead of ASP.NET Core's own ActivatorUtilities-based activation - useful if you want SimpleInjector's Verify() to cover controllers too, or want their lifetime governed by the native container like any other registration.
AddAspNetCore<TStartupFilter>() is also available, as a convenience for registering a custom IStartupFilter through the native IServiceRegister API instead of IServiceCollection.AddSingleton<IStartupFilter, T>() - the two are otherwise interchangeable under the default Hybrid constructor resolution. The non-generic AddAspNetCore() is obsolete.
Main types
ServiceResolverControllerActivator— theIControllerActivatorimplementation used byAddControllerActivation().
Related packages
ServiceResolver.GenericHost
For the full guide, see the documentation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- ServiceResolver.GenericHost (>= 3.8.0)
-
net6.0
- ServiceResolver.GenericHost (>= 3.8.0)
-
net8.0
- ServiceResolver.GenericHost (>= 3.8.0)
-
net9.0
- ServiceResolver.GenericHost (>= 3.8.0)
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.8.0 | 100 | 9/9/2026 |
| 3.7.0 | 109 | 8/24/2026 |
| 3.6.4 | 97 | 8/21/2026 |
| 3.6.3 | 107 | 8/20/2026 |
| 3.6.2 | 93 | 8/20/2026 |
| 3.6.1 | 1,869 | 12/1/2025 |
| 3.5.2 | 698 | 8/6/2025 |
| 3.5.1 | 162 | 8/3/2025 |
| 3.4.2 | 301 | 6/24/2025 |
| 3.4.1 | 979 | 3/4/2025 |
| 3.4.1-rc2 | 189 | 2/27/2025 |
| 3.4.1-rc1 | 185 | 2/27/2025 |
| 3.3.2 | 316 | 11/25/2024 |
| 3.3.1 | 424 | 10/10/2024 |
| 3.2.1 | 214 | 9/10/2024 |
| 3.1.1 | 267 | 9/9/2024 |
| 2.2.1 | 731 | 4/5/2024 |
| 2.1.1 | 209 | 2/28/2024 |
| 1.0.1 | 218 | 1/26/2024 |