Table of Contents

Invex.Extensions.Hosting Documentation

Invex.Extensions.Hosting is a small, focused library of utilities for Microsoft.Extensions.Hosting that fills three common gaps in the generic host programming model:

Feature Problem it solves
Multi-interface registration Registering one implementation under several service types without creating duplicate instances.
Host control Stopping the application gracefully with a specific process exit code.
Cycle background service Running periodic background work on a fixed, drift-free cadence.

Contents

Guides

API reference

The full API reference lives in the api/ directory:

Design principles

  • Tiny surface area. The library exposes exactly four public types. Everything else is internal.
  • No behavioral surprises. All extensions compose the standard Microsoft.Extensions.DependencyInjection and Microsoft.Extensions.Hosting primitives; nothing replaces or intercepts host behavior.
  • Broad compatibility. Targets netstandard2.0 through net10.0, so it works in both legacy applications (including .NET Framework 4.8, via the netstandard2.0 build) and modern ones.
  • Trimming/AOT friendly. On .NET 8+, implementation type parameters are annotated with [DynamicallyAccessedMembers] so trimming preserves the constructors the DI container needs.
  • Stable public API. The public API surface is locked by snapshot tests (PublicApiTests); any accidental breaking change fails the build.

Versioning and support

The package follows semantic versioning (versions are generated by GitVersion). Breaking changes only occur in major releases.

License

MIT — see LICENSE.txt.