Curiosus.Hosting 3.0.0

dotnet add package Curiosus.Hosting --version 3.0.0
                    
NuGet\Install-Package Curiosus.Hosting -Version 3.0.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="Curiosus.Hosting" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Curiosus.Hosting" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Curiosus.Hosting" />
                    
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 Curiosus.Hosting --version 3.0.0
                    
#r "nuget: Curiosus.Hosting, 3.0.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 Curiosus.Hosting@3.0.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=Curiosus.Hosting&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Curiosus.Hosting&version=3.0.0
                    
Install as a Cake Tool

Curiosus.Hosting

NuGet Downloads Coverage

App bootstrappers for console tools and background services. They parse CLI arguments, load and validate a YAML config, set up NLog and the default culture, run registered IAppInitializers and then start the app.

Installation

dotnet add package Curiosus.Hosting

Usage

Inherit a configuration from CuriosusAppConfiguration and a bootstrapper from CuriosusServiceAppBootstrapper (generic host with hosted services) or CuriosusToolAppBootstrapper (a DI container plus a one-shot ExecuteAsync).

public class AppConfiguration : CuriosusAppConfiguration
{
    public AppConfiguration()
    {
        AppName = "Sample Worker";
    }
}

public class AppBootstrapper : CuriosusServiceAppBootstrapper<CuriosusCLIArguments, AppConfiguration>
{
    public AppBootstrapper()
    {
        ConfigureServices((context, services, configuration) =>
        {
            services.AddHostedService<SampleWorker>();
        });
    }
}

// Program.cs
return await new AppBootstrapper().RunAsync(args);

The config is read from config.yml in the directory passed with -c|--config (the current working directory by default). It is overridden by config.secret.yml, config.{ASPNETCORE_ENVIRONMENT}.yml, environment variables and CLI arguments.

AppName: Sample Worker
Culture:
  DefaultCulture: en-US
Log:
  LogConfigurationPath: ./NLog.config
  LogOutputDirectory: ./logs

RunAsync returns an exit code from CuriosusExitCodes (e.g. IncorrectConfiguration when validation fails). The configuration, the CLI arguments and a non-generic ILogger are registered in DI.

Other helpers:

  • CuriosusWatchdog — base BackgroundService that calls ProcessAsync periodically and survives exceptions.
  • AddThreadPoolTuning(ThreadPoolOptions) — sets minimum thread pool size, logs its state and can auto-tune it.
  • AddTempDirCleaner(TempFileOptions) — hosted service that deletes stale temp files.
  • IConfigurationWithMailLogger — implement it in your config to pass SMTP settings (LoggerMail) to the mail target variables of your NLog.config.

See also

Product Compatible and additional computed target framework versions.
.NET 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 (1)

Showing the top 1 NuGet packages that depend on Curiosus.Hosting:

Package Downloads
Curiosus.Hosting.Web

Hosting tools for Web applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 0 10/3/2026
2.0.0 62 9/28/2026