Fluxera.Extensions.Hosting.Abstractions
6.0.3
Prefix Reserved
See the version list below for details.
dotnet add package Fluxera.Extensions.Hosting.Abstractions --version 6.0.3
NuGet\Install-Package Fluxera.Extensions.Hosting.Abstractions -Version 6.0.3
<PackageReference Include="Fluxera.Extensions.Hosting.Abstractions" Version="6.0.3" />
paket add Fluxera.Extensions.Hosting.Abstractions --version 6.0.3
#r "nuget: Fluxera.Extensions.Hosting.Abstractions, 6.0.3"
// Install Fluxera.Extensions.Hosting.Abstractions as a Cake Addin #addin nuget:?package=Fluxera.Extensions.Hosting.Abstractions&version=6.0.3 // Install Fluxera.Extensions.Hosting.Abstractions as a Cake Tool #tool nuget:?package=Fluxera.Extensions.Hosting.Abstractions&version=6.0.3
Fluxera.Extensions.Hosting
A library that extends the Microsoft.Extensions.Hosting library with modular host implementations for various application platforms.
The library uses the generic host implementation and build a modular structure upon it. It is possible to split your application into login modules that can be shared between different types of applications.
Available Hosts
The modular host is available for the following applicattion types:
- ASP.NET Core
- Blazor WebAssembly
- Console / Windows Service
- WPF
- Xamarin Forms
After the final release of .NET MAUI which is already built upon the generic host infrastructure we will add the modular capabilities to it.
Usage
Every application needs a host and a startup module class. The application is composed of modules that define dependencies on other modules and optional modules that are loaded as plugins.
public class ConsoleApplicationModule : ConfigureServicesModule
{
public override void ConfigureServices(IServiceConfigurationContext context)
{
context.Services.AddHostedService<ConsoleHostedService>();
context.Services.AddSingleton<IWeatherService, WeatherService>();
context.Services.AddOptions<WeatherSettings>().Bind(context.Configuration.GetSection("Weather"));
}
}
This startup module just configures some services and regiosters them in the service collection. The service confiuration pipelineis split up into three steps: pre-configure-, configure- and post-configure-services. Each methos is executed in every module, before moving to the next method.
If you need to configure the application after the creation of the service provider you can just
use the base class ConfigureApplicationModule
which provides a similar three step
pipeline for initializing the application: pre-configure, configure and post-configure. Additionally
this base class provides a methos that is executed on every module when the application shuts down.
In addtition to the two base classes ConfigureServicesModule
and ConfigureApplicationModule
you are free to use one of the module interfaces to meet you configuration needs.
- IModule
- IConfigureServicesModule
- IPreConfigureServices
- IConfigureServices
- IPostConfigureServices
- IConfigureApplicationModule
- IPreConfigureApplication
- IConfigureApplication
- IPostConfigureApplication
- IShutdownApplicationModule
- IConfigureServicesModule
You can even just implement the IModule
interface on your module class, if you don't need any
configuration and application initialization.
public class ConsoleApplicationHost : ConsoleApplicationHost<ConsoleApplicationModule>
{
}
The simplest application host class just inherits from one of the available base classes for the application type you are running.
Each base class provides several methods you can overide to configure additional plugin modules, or a custom logger to use while bootstrapping the host. Please refer to the samples for more information.
public static class Program
{
public static async Task Main(string[] args)
{
await ApplicationHost.RunAsync<ConsoleApplicationHost>(args);
Console.WriteLine();
Console.WriteLine("Press any key to quit...");
Console.ReadKey(true);
}
}
All what's left to do is to run the host using one of the available static entry-points.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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. |
.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
- Fluxera.Extensions.DependencyInjection.Abstractions (>= 6.0.19)
- Fluxera.Guards (>= 6.0.11)
- JetBrains.Annotations (>= 2021.3.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Fluxera.Extensions.Hosting.Abstractions:
Package | Downloads |
---|---|
Fluxera.Extensions.Hosting
A modular application host. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
9.0.1 | 540 | 11/16/2024 |
9.0.0 | 141 | 11/14/2024 |
8.2.4 | 720 | 11/1/2024 |
8.2.3 | 275 | 7/9/2024 |
8.2.2 | 2,183 | 6/15/2024 |
8.2.1 | 947 | 6/2/2024 |
8.2.0 | 1,000 | 5/26/2024 |
8.1.3 | 2,512 | 4/26/2024 |
8.1.2 | 235 | 4/26/2024 |
8.1.1 | 243 | 4/26/2024 |
8.1.0 | 908 | 4/24/2024 |
8.0.7 | 5,663 | 4/18/2024 |
8.0.6 | 1,113 | 4/13/2024 |
8.0.5 | 251 | 4/13/2024 |
8.0.4 | 1,117 | 3/19/2024 |
8.0.3 | 3,275 | 2/22/2024 |
8.0.2 | 7,708 | 1/4/2024 |
8.0.1 | 1,169 | 11/23/2023 |
8.0.0 | 1,545 | 11/15/2023 |
7.1.9 | 1,201 | 7/23/2023 |
7.1.8 | 270 | 7/20/2023 |
7.1.7 | 1,005 | 6/21/2023 |
7.1.6 | 2,367 | 4/25/2023 |
7.1.5 | 2,899 | 4/24/2023 |
7.1.4 | 1,210 | 4/13/2023 |
7.1.3 | 1,390 | 3/16/2023 |
7.1.2 | 2,119 | 2/28/2023 |
7.1.1 | 1,749 | 1/26/2023 |
7.1.0 | 2,205 | 1/18/2023 |
7.0.6 | 4,117 | 12/22/2022 |
7.0.5 | 441 | 12/13/2022 |
7.0.4 | 3,034 | 12/9/2022 |
7.0.3 | 493 | 11/24/2022 |
7.0.2 | 529 | 11/15/2022 |
7.0.1 | 517 | 11/12/2022 |
7.0.0 | 502 | 11/9/2022 |
6.2.2 | 6,544 | 10/12/2022 |
6.2.1 | 9,441 | 10/9/2022 |
6.2.0 | 5,650 | 10/1/2022 |
6.1.1 | 5,660 | 9/20/2022 |
6.1.0 | 5,871 | 9/16/2022 |
6.0.17 | 5,497 | 9/15/2022 |
6.0.14 | 5,824 | 7/30/2022 |
6.0.13 | 5,667 | 6/30/2022 |
6.0.12 | 5,643 | 6/15/2022 |
6.0.11 | 5,426 | 6/7/2022 |
6.0.10 | 12,378 | 5/28/2022 |
6.0.9 | 18,993 | 5/10/2022 |
6.0.8 | 5,134 | 5/5/2022 |
6.0.7 | 1,733 | 4/20/2022 |
6.0.6 | 1,715 | 4/20/2022 |
6.0.5 | 1,702 | 4/11/2022 |
6.0.4 | 1,684 | 4/10/2022 |
6.0.3 | 1,706 | 3/24/2022 |
6.0.2 | 1,700 | 2/17/2022 |
6.0.1 | 867 | 12/23/2021 |