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
                    
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="ServiceResolver.GenericHost.AspNetCore" Version="3.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ServiceResolver.GenericHost.AspNetCore" Version="3.8.0" />
                    
Directory.Packages.props
<PackageReference Include="ServiceResolver.GenericHost.AspNetCore" />
                    
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 ServiceResolver.GenericHost.AspNetCore --version 3.8.0
                    
#r "nuget: ServiceResolver.GenericHost.AspNetCore, 3.8.0"
                    
#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 ServiceResolver.GenericHost.AspNetCore@3.8.0
                    
#: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=ServiceResolver.GenericHost.AspNetCore&version=3.8.0
                    
Install as a Cake Addin
#tool nuget:?package=ServiceResolver.GenericHost.AspNetCore&version=3.8.0
                    
Install as a Cake Tool

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 — the IControllerActivator implementation used by AddControllerActivation().
  • ServiceResolver.GenericHost

For the full guide, see the documentation.

Product 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. 
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
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