ServiceResolver.GenericHost
3.6.4
dotnet add package ServiceResolver.GenericHost --version 3.6.4
NuGet\Install-Package ServiceResolver.GenericHost -Version 3.6.4
<PackageReference Include="ServiceResolver.GenericHost" Version="3.6.4" />
<PackageVersion Include="ServiceResolver.GenericHost" Version="3.6.4" />
<PackageReference Include="ServiceResolver.GenericHost" />
paket add ServiceResolver.GenericHost --version 3.6.4
#r "nuget: ServiceResolver.GenericHost, 3.6.4"
#:package ServiceResolver.GenericHost@3.6.4
#addin nuget:?package=ServiceResolver.GenericHost&version=3.6.4
#tool nuget:?package=ServiceResolver.GenericHost&version=3.6.4
ServiceResolver.GenericHost is the engine-agnostic bridge between ServiceResolver.Ioc and Microsoft.Extensions.Hosting's IHostBuilder.
Using SimpleInjector? Install
ServiceResolver.GenericHost.SimpleInjectorinstead — it already implements this bridge for you. This package is for wiring up your ownIServiceRegisterProviderimplementation.
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 toUseServiceResolver.IServiceRegisterBuilder<TServiceRegister>— the contract behindServiceRegisterOptions<TServiceRegister>.IServiceProviderAdapter— theIServiceProvidersurface exposed back toMicrosoft.Extensions.Hosting.ServiceResolverBuilder<TServiceRegister>— theIServiceProviderFactory<TServiceRegister>implementation used internally byUseServiceResolver.
Related packages
Microsoft.Extensions.HostingServiceResolver.Ioc
For the full guide, see the documentation.
| 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
- Microsoft.Extensions.Hosting (>= 8.0.1)
- ServiceResolver.Ioc (>= 2.9.3)
-
net10.0
- Microsoft.Extensions.Hosting (>= 10.0.11)
- ServiceResolver.Ioc (>= 2.9.3)
-
net6.0
- Microsoft.Extensions.Hosting (>= 8.0.1)
- ServiceResolver.Ioc (>= 2.9.3)
-
net8.0
- Microsoft.Extensions.Hosting (>= 10.0.11)
- ServiceResolver.Ioc (>= 2.9.3)
-
net9.0
- Microsoft.Extensions.Hosting (>= 10.0.11)
- ServiceResolver.Ioc (>= 2.9.3)
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 |