ServiceResolver.GenericHost 3.6.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package ServiceResolver.GenericHost --version 3.6.2
                    
NuGet\Install-Package ServiceResolver.GenericHost -Version 3.6.2
                    
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" Version="3.6.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ServiceResolver.GenericHost" Version="3.6.2" />
                    
Directory.Packages.props
<PackageReference Include="ServiceResolver.GenericHost" />
                    
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 --version 3.6.2
                    
#r "nuget: ServiceResolver.GenericHost, 3.6.2"
                    
#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@3.6.2
                    
#: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&version=3.6.2
                    
Install as a Cake Addin
#tool nuget:?package=ServiceResolver.GenericHost&version=3.6.2
                    
Install as a Cake Tool

ServiceResolver.GenericHost is the engine-agnostic bridge between ServiceResolver.Ioc and Microsoft.Extensions.Hosting's IHostBuilder.

Using SimpleInjector? Install ServiceResolver.GenericHost.SimpleInjector instead — it already implements this bridge for you. This package is for wiring up your own IServiceRegisterProvider implementation.

Getting started

class CustomServiceRegisterProvider : IServiceRegisterProvider
{
    public CustomServiceRegisterProvider(CustomServiceRegisterDescriptor descriptor)
    {
        // your setup code ..
    }

    // ... remaining IServiceRegisterProvider members
}

var hostBuilder = Host.CreateDefaultBuilder(args)
    .UseServiceResolver(new ServiceRegisterOptions<IServiceRegisterProvider>
    {
        // a factory used to create your service register provider
        OnCreating = collection => new CustomServiceRegisterProvider(new CustomServiceRegisterDescriptor()),
        // an action used to register your services
        OnRegistering = provider =>
        {
            provider.Register<StringBuilder>(() => new StringBuilder("hello world.."));
        }
    });

var host = hostBuilder.Build();

await host.RunAsync();

An overload taking Func<HostBuilderContext, ServiceRegisterOptions<TServiceRegister>> is also available when you need access to configuration or environment during setup.

Main types

  • ServiceRegisterOptions<TServiceRegister> — the configuration passed to UseServiceResolver.
  • IServiceRegisterBuilder<TServiceRegister> — the contract behind ServiceRegisterOptions<TServiceRegister>.
  • IServiceProviderAdapter — the IServiceProvider surface exposed back to Microsoft.Extensions.Hosting.
  • ServiceResolverBuilder<TServiceRegister> — the IServiceProviderFactory<TServiceRegister> implementation used internally by UseServiceResolver.
  • Microsoft.Extensions.Hosting
  • ServiceResolver.Ioc

For the full guide, see the documentation.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ServiceResolver.GenericHost:

Package Downloads
ServiceResolver.GenericHost.SimpleInjector

ServiceResolver.GenericHost.SimpleInjector is an abstract library for .NET generic host, using ServiceResolver.Ioc.SimpleInjector integration.

ServiceResolver.GenericHost.AspNetCore

ServiceResolver.GenericHost.AspNetCore is an abstract library for .NET generic host in AspNetCore framework, using ServiceResolver.Ioc integration.

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 44 8/20/2026
3.6.2 45 8/20/2026
3.6.1 2,200 12/1/2025
3.5.2 778 8/6/2025
3.5.1 215 8/3/2025
3.4.2 479 6/24/2025
3.4.1 1,650 3/4/2025
3.4.1-rc2 255 2/27/2025
3.4.1-rc1 236 2/27/2025
3.3.2 610 11/25/2024
3.3.1 622 10/10/2024
3.2.1 354 9/10/2024
3.1.1 343 9/9/2024
2.2.1 1,116 4/5/2024
2.1.1 457 2/28/2024
1.1.1 288 2/8/2024
1.0.1 299 1/26/2024