Skip to content

SAIF.NetCore.WindowsService dependencies

This library takes a single internal NuGet dependency, on the foundation-layer SAIF.NetCore.ServiceContracts, plus four Microsoft.Extensions.Hosting-family packages for Generic Host support; it makes no outbound API calls of its own, relying entirely on services a consumer resolves from the DI container at runtime.

Internal dependencies

Dependency Reference Type Usage
SAIF.NetCore.ServiceContracts NuGet Package (same-repo) Supplies IServiceTaskRunner, IWindowsServiceErrorHandler, ISaifWindowsServiceLogService, and ShutdownExemptExceptionType, which ServiceProgramRunnerBase and ServiceWorker<T> depend on and resolve from the DI container.

External dependencies

Dependency Version Usage
Microsoft.Extensions.Configuration.Binder 8.0.0 Supplies IConfiguration.GetValue<int?>, used to read the DelayStart startup-delay setting.
Microsoft.Extensions.Hosting 8.0.0 Supplies Host.CreateDefaultBuilder, IHost.Run, and IHost.StopAsync, used to build and run the Generic Host.
Microsoft.Extensions.Hosting.Abstractions 8.0.0 Supplies BackgroundService, IHost, and IHostBuilder, the base types for ServiceWorker<T> and the host-building API.
Microsoft.Extensions.Hosting.WindowsServices 8.0.0 Supplies .UseWindowsService(), used by CreateHostBuilder to run the host under the Windows Service Control Manager.

Dependency risks and notes

  • The library makes no outbound API calls of its own (no HttpClient use and no hard-coded URLs); all outbound HTTP comes from services it resolves but does not implement — the Logging API call made by the consumer-supplied ISaifWindowsServiceLogService (implemented by SAIF.NetCore.Logging) and any logging/error-reporting path inside the resolved IWindowsServiceErrorHandler (implemented by SAIF.NetCore.ErrorHandler) — so those calls are documented in the Logging and ErrorHandler libraries' own dependency pages, not here.
  • CreateHostBuilder appends AddJsonFile("appsettings.json", optional: true) and AddEnvironmentVariables() after the configuration sources Host.CreateDefaultBuilder already registers; because later sources win, appsettings.json can override environment-specific settings and unprefixed environment variables can override command-line arguments*.
  • The library requires five services it does not register — IServiceTaskRunner (consumer-supplied), IWindowsServiceErrorHandler, ISaifWindowsServiceLogService, IEnvironmentClient, and IHttpJsonClient — and in practice a consumer satisfies the latter four by also referencing SAIF.NetCore.ServiceExtensions and calling RegisterForWindowsService/RegisterForWindowsService<T>, though an equivalent manual registration of the same four contracts is also possible without that call.
  • ServiceProgramRunnerBase.ServiceHost is a static, process-global reference, so only one host per process is supported; a ServiceWorker<T> hosted outside a ServiceProgramRunnerBase-derived program fails with a NullReferenceException on its first non-exempt task error*.
  • net10.0 is one of this library's two target frameworks, but it is compiled against 8.0.0 Microsoft.Extensions.* packages, and the net8.0 target reaches end-of-support 2026-11-10.
  • The csproj's <DocumentationFile> is a stale, pre-mono-repo absolute path (C:\tfsgit\Framework.NCore.WindowsService\SAIF.NetCore.WindowsService\SAIF.NetCore.WindowsService\SAIF.NetCore.WindowsService.xml), so the checked-in XML doc is not refreshed by current builds, and whether the packed .nupkg still includes XML documentation is unverified.
  • This library has no in-repo consumer and no test project, so its dependency surface is unverified against a real consumer in this repository.

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • src/SAIF.NetCore.WindowsService/SAIF.NetCore.WindowsService/SAIF.NetCore.WindowsService/ServiceWorker.cs
  • src/SAIF.NetCore.WindowsService/SAIF.NetCore.WindowsService/SAIF.NetCore.WindowsService/ServiceProgramRunnerBase.cs
  • src/SAIF.NetCore.WindowsService/SAIF.NetCore.WindowsService/SAIF.NetCore.WindowsService/SAIF.NetCore.WindowsService.csproj