![]() |
VOOZH | about |
dotnet add package NexusLabs.Needlr.Hosting --version 0.0.2-alpha-0064
NuGet\Install-Package NexusLabs.Needlr.Hosting -Version 0.0.2-alpha-0064
<PackageReference Include="NexusLabs.Needlr.Hosting" Version="0.0.2-alpha-0064" />
<PackageVersion Include="NexusLabs.Needlr.Hosting" Version="0.0.2-alpha-0064" />Directory.Packages.props
<PackageReference Include="NexusLabs.Needlr.Hosting" />Project file
paket add NexusLabs.Needlr.Hosting --version 0.0.2-alpha-0064
#r "nuget: NexusLabs.Needlr.Hosting, 0.0.2-alpha-0064"
#:package NexusLabs.Needlr.Hosting@0.0.2-alpha-0064
#addin nuget:?package=NexusLabs.Needlr.Hosting&version=0.0.2-alpha-0064&prereleaseInstall as a Cake Addin
#tool nuget:?package=NexusLabs.Needlr.Hosting&version=0.0.2-alpha-0064&prereleaseInstall as a Cake Tool
Generic Host support for Needlr - enables auto-discovery and plugin system for worker services and console applications.
using NexusLabs.Needlr.Hosting;
using NexusLabs.Needlr.Injection;
var host = new Syringe()
.ForHost()
.UsingOptions(() => CreateHostOptions.Default
.UsingArgs(args)
.UsingApplicationName("MyWorkerService"))
.BuildHost();
await host.RunAsync();
using Microsoft.Extensions.Hosting;
using NexusLabs.Needlr.Hosting;
using NexusLabs.Needlr.Injection;
var builder = Host.CreateApplicationBuilder(args);
// Your own configuration
builder.Services.AddMyServices();
// Add Needlr discovery
builder.UseNeedlrDiscovery();
var host = builder.Build();
// Optionally run IHostPlugin plugins
host.RunHostPlugins();
await host.RunAsync();
Runs during builder configuration (before Build()):
public sealed class MyBuilderPlugin : IHostApplicationBuilderPlugin
{
public void Configure(HostApplicationBuilderPluginOptions options)
{
options.Builder.Services.AddSingleton<IMyService, MyService>();
}
}
Runs after Build() but before Run():
public sealed class MyHostPlugin : IHostPlugin
{
public void Configure(HostPluginOptions options)
{
var service = options.Host.Services.GetRequiredService<IMyService>();
service.Initialize();
}
}
ForHost() - Transitions Syringe to host mode, Needlr controls lifecycleUseNeedlrDiscovery() - Integrates discovery into user-controlled buildersIHostedService auto-discovery - Background services registered automatically| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on NexusLabs.Needlr.Hosting:
| Package | Downloads |
|---|---|
|
NexusLabs.Needlr.AspNet
Package Description |
|
|
NexusLabs.Needlr.Serilog
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.2-alpha-0064 | 53 | 6/17/2026 |
| 0.0.2-alpha-0063 | 139 | 6/16/2026 |
| 0.0.2-alpha-0062 | 122 | 6/14/2026 |
| 0.0.2-alpha-0061 | 246 | 6/9/2026 |
| 0.0.2-alpha-0060 | 167 | 6/8/2026 |
| 0.0.2-alpha-0059 | 610 | 5/12/2026 |
| 0.0.2-alpha-0058 | 191 | 5/11/2026 |
| 0.0.2-alpha-0057 | 199 | 5/10/2026 |
| 0.0.2-alpha-0056 | 190 | 5/7/2026 |
| 0.0.2-alpha-0055 | 191 | 5/7/2026 |
| 0.0.2-alpha-0054 | 197 | 5/7/2026 |
| 0.0.2-alpha-0053 | 180 | 5/6/2026 |
| 0.0.2-alpha-0052 | 189 | 5/6/2026 |
| 0.0.2-alpha-0051 | 215 | 5/4/2026 |
| 0.0.2-alpha-0050 | 190 | 5/2/2026 |
| 0.0.2-alpha-0049 | 192 | 5/2/2026 |
| 0.0.2-alpha-0048 | 164 | 5/1/2026 |
| 0.0.2-alpha-0047 | 230 | 4/25/2026 |
| 0.0.2-alpha-0046 | 167 | 4/20/2026 |