CasCap.Common.Services
4.16.0
Prefix Reserved
See the version list below for details.
dotnet add package CasCap.Common.Services --version 4.16.0
NuGet\Install-Package CasCap.Common.Services -Version 4.16.0
<PackageReference Include="CasCap.Common.Services" Version="4.16.0" />
<PackageVersion Include="CasCap.Common.Services" Version="4.16.0" />
<PackageReference Include="CasCap.Common.Services" />
paket add CasCap.Common.Services --version 4.16.0
#r "nuget: CasCap.Common.Services, 4.16.0"
#:package CasCap.Common.Services@4.16.0
#addin nuget:?package=CasCap.Common.Services&version=4.16.0
#tool nuget:?package=CasCap.Common.Services&version=4.16.0
CasCap.Common.Services
Run selected .NET background features by name, observe their lifecycle and expose assembly-backed application metadata.
Installation
dotnet add package CasCap.Common.Services
Target frameworks: net8.0, net9.0, net10.0
Usage
Register implementations as
IBgFeature,
then supply the enabled names to the launcher:
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using CasCap.Common.Abstractions;
using CasCap.Common.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddSingleton<IBgFeature, WorkerFeature>();
builder.Services.AddFeatureFlagService(
new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "Worker" });
await builder.Build().RunAsync();
public sealed class WorkerFeature(ILogger<WorkerFeature> logger) : IBgFeature
{
public string FeatureName => "Worker";
public async Task ExecuteAsync(CancellationToken cancellationToken)
{
while (!cancellationToken.IsCancellationRequested)
{
logger.LogInformation("Worker is active");
await Task.Delay(TimeSpan.FromMinutes(1), cancellationToken);
}
}
}
Feature matching is case-insensitive. A feature named IBgFeature.AlwaysEnabled ("All") runs
regardless of the selected set. Registration supplies IOptions<FeatureFlagConfig>; it does not
automatically read an EnabledFeatures JSON section.
Service Architecture
- No matching features is a startup failure.
- A child may finish while siblings continue. Faults from enabled children propagate to the host.
- If all children finish before cancellation, the launcher reports an unexpected lifecycle failure.
- A finite job must request
IHostApplicationLifetime.StopApplication()before returning. - Host cancellation ends the launcher cleanly.
flowchart TD
HOST["Host startup"] --> MATCH["Match registered features against enabled names"]
MATCH --> RUN["Run matching features and All features"]
RUN --> WATCH["Observe child tasks"]
WATCH -->|Child finishes, siblings remain| WATCH
WATCH -->|Child faults or all finish without stopping| FAIL["Propagate failure to host"]
WATCH -->|Host cancellation or requested stop| STOP["Clean shutdown"]
Configuration Examples
Feature Execution Only
The registration in Usage enables the selected features without periodic metadata logging.
Feature Execution with Metadata
Pass addApplicationMetadataService: true to register ApplicationMetadataBgService and
ApplicationMetadata. The latter reads version, source revision and build context from assembly
attributes, not live Git state.
builder.Services.AddFeatureFlagService(enabledFeatures, addApplicationMetadataService: true);
The optional metadata service binds ApplicationMetadataConfig. Its LogInterval defaults to one
minute and must be positive:
{
"ApplicationMetadataConfig": {
"LogInterval": "00:05:00"
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. 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. |
-
net10.0
- CasCap.Common.Abstractions (>= 4.16.0)
- CasCap.Common.Extensions (>= 4.16.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.13)
-
net8.0
- CasCap.Common.Abstractions (>= 4.16.0)
- CasCap.Common.Extensions (>= 4.16.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.13)
-
net9.0
- CasCap.Common.Abstractions (>= 4.16.0)
- CasCap.Common.Extensions (>= 4.16.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.13)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on CasCap.Common.Services:
| Package | Downloads |
|---|---|
|
CasCap.Api.SignalCli
Typed .NET client for the signal-cli REST API with REST polling and JSON-RPC WebSocket transports, health checks, and INotifier integration. |
|
|
CasCap.Common.OpenTelemetry
Reusable OpenTelemetry configuration with standard metrics, traces, and log exporters. |
|
|
CasCap.Api.Voice
Provider-neutral speech-to-text and text-to-speech components for .NET applications. |
|
|
CasCap.Common.Hosting.AspNetCore
ASP.NET Core hosting defaults for feature-gated controllers, Serilog, and OpenTelemetry metrics, traces, and logs. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.2.1 | 50 | 11/21/2026 |
| 5.2.0 | 294 | 11/14/2026 |
| 5.1.0 | 429 | 11/5/2026 |
| 5.0.0 | 254 | 11/1/2026 |
| 4.17.0 | 343 | 10/24/2026 |
| 4.16.0 | 296 | 10/21/2026 |
| 4.15.0 | 163 | 10/6/2026 |
| 4.14.4 | 270 | 10/4/2026 |
| 4.14.3 | 168 | 9/28/2026 |
| 4.14.2 | 306 | 9/25/2026 |
| 4.14.1 | 369 | 9/23/2026 |
| 4.14.0 | 357 | 9/19/2026 |
| 4.13.0 | 155 | 9/15/2026 |
| 4.12.8 | 183 | 9/10/2026 |
| 4.12.7 | 156 | 9/4/2026 |
| 4.12.6 | 137 | 9/1/2026 |
| 4.12.5 | 151 | 8/20/2026 |
| 4.12.4 | 161 | 8/18/2026 |
| 4.12.3 | 166 | 7/15/2026 |
| 4.12.2 | 179 | 6/26/2026 |