![]() |
VOOZH | about |
dotnet add package Dosaic.Plugins.Management.Unleash --version 1.2.34
NuGet\Install-Package Dosaic.Plugins.Management.Unleash -Version 1.2.34
<PackageReference Include="Dosaic.Plugins.Management.Unleash" Version="1.2.34" />
<PackageVersion Include="Dosaic.Plugins.Management.Unleash" Version="1.2.34" />Directory.Packages.props
<PackageReference Include="Dosaic.Plugins.Management.Unleash" />Project file
paket add Dosaic.Plugins.Management.Unleash --version 1.2.34
#r "nuget: Dosaic.Plugins.Management.Unleash, 1.2.34"
#:package Dosaic.Plugins.Management.Unleash@1.2.34
#addin nuget:?package=Dosaic.Plugins.Management.Unleash&version=1.2.34Install as a Cake Addin
#tool nuget:?package=Dosaic.Plugins.Management.Unleash&version=1.2.34Install as a Cake Tool
Dosaic.Plugins.Management.Unleash is a Dosaic plugin that integrates Unleash feature flag management into ASP.NET Core applications. It bridges the Unleash client SDK with the Microsoft.FeatureManagement abstraction, enabling gradual rollouts, experimentation, and kill-switch controls without redeployment.
dotnet add package Dosaic.Plugins.Management.Unleash
Or as a <PackageReference> in your .csproj:
<PackageReference Include="Dosaic.Plugins.Management.Unleash" Version="" />
Dependencies:
Microsoft.FeatureManagement.AspNetCore — feature flag abstractionUnleash.Client — Unleash .NET client SDKAspNetCore.HealthChecks.Uris — URL-based health checkThe plugin reads its settings from the unleash section of your application configuration, bound via [Configuration("unleash")].
unleash:
appName: "my-app"
apiUri: "http://localhost:4242/api/"
apiToken: "default:development.your-api-token-here"
instanceTag: "instance-1"
| Property | Description |
|---|---|
appName |
Name of your application, reported to the Unleash server |
apiUri |
Full URI to your Unleash API, e.g. http://localhost:4242/api/ |
apiToken |
API token created in the Unleash web UI |
instanceTag |
Unique tag to identify this running instance |
Inject IFeatureManager and call IsEnabledAsync with the toggle name as defined in Unleash:
using Microsoft.FeatureManagement;
public class OrderService(IFeatureManager featureManager)
{
public async Task<IActionResult> PlaceOrder(OrderRequest request)
{
if (await featureManager.IsEnabledAsync("new-checkout-flow"))
{
return await HandleNewCheckout(request);
}
return await HandleLegacyCheckout(request);
}
}
[FeatureGate]Apply [FeatureGate] at the controller or action level. When the toggle is disabled, the plugin returns a 404 Not Found response (via FeatureNotEnabledDisabledHandler).
using Microsoft.FeatureManagement.Mvc;
[ApiController, Route("beta")]
[FeatureGate("beta-api")]
public class BetaController : ControllerBase
{
[HttpGet("feature-a")]
[FeatureGate("feature-a")]
public IActionResult GetFeatureA() => Ok("Feature A is active");
[HttpPost("feature-b")]
[FeatureGate("feature-b")]
public IActionResult PostFeatureB() => Ok("Feature B is active");
}
Add the tag helper and use the <feature> tag to conditionally render view content:
@addTagHelper *, Microsoft.FeatureManagement.AspNetCore
<feature name="dark-mode">
<link rel="stylesheet" href="~/css/dark.css" />
</feature>
<feature name="dark-mode" negate="true">
<link rel="stylesheet" href="~/css/light.css" />
</feature>
Gate an entire middleware on a feature toggle:
app.UseMiddlewareForFeature<AnalyticsMiddleware>("analytics-tracking");
Register an MVC action filter that is only active when a toggle is enabled:
services.AddMvc(options =>
{
options.Filters.AddForFeature<AuditFilter>("audit-logging");
});
FeatureToggleType provides constants for the standard Unleash toggle strategies:
using Dosaic.Plugins.Management.Unleash;
// Reference toggle types by their string constant
if (toggle.Type == FeatureToggleType.KillSwitch)
{
// handle kill-switch logic
}
| Constant | Value |
|---|---|
FeatureToggleType.Release |
"release" |
FeatureToggleType.Experiment |
"experiment" |
FeatureToggleType.Operational |
"operational" |
FeatureToggleType.KillSwitch |
"killSwitch" |
FeatureToggleType.Permission |
"permission" |
Automatic Unleash context propagation — UnleashMiddlware ([Middleware(50)]) builds an UnleashContext per request, populating UserId (from HttpContext.User.Identity.Name), AppName, CurrentTime, RemoteAddress, and (optionally) SessionId when session middleware is registered.
Microsoft.FeatureManagement integration — UnleashFeatureDefinitionProvider exposes all Unleash toggles as FeatureDefinition instances, and UnleashFilter ([FilterAlias("Unleash")]) evaluates them via the Unleash client, making IFeatureManager the single API for all feature checks.
Disabled feature handler — when a [FeatureGate]-protected endpoint is accessed but the flag is off, FeatureNotEnabledDisabledHandler raises a NotFoundDosaicException, resulting in a 404 response.
Health check — registers a readiness URL health check against {apiUri}/health under the name unleash.
OpenTelemetry metrics — emits four counters automatically:
| Metric | Description |
|---|---|
dosaic_unleash_plugin_impressions_total |
Number of impression events (labelled by featureName, enabled) |
dosaic_unleash_plugin_errors_total |
Number of Unleash client error events |
dosaic_unleash_plugin_toggleUpdates_total |
Number of toggle cache refresh events |
dosaic_unleash_plugin_unleash_filter_calls_total |
Number of UnleashFilter evaluations (labelled by featureName, isEnabled) |
Structured logging — impression events are logged at Debug, toggle updates at Information, and errors at Error level.
| 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. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.34 | 91 | 6/10/2026 |
| 1.2.33 | 99 | 6/2/2026 |
| 1.2.31 | 104 | 5/28/2026 |
| 1.2.30 | 105 | 5/7/2026 |
| 1.2.29 | 93 | 5/5/2026 |
| 1.2.28 | 104 | 4/30/2026 |
| 1.2.27 | 108 | 4/29/2026 |
| 1.2.26 | 100 | 4/29/2026 |
| 1.2.25 | 109 | 4/27/2026 |
| 1.2.24 | 97 | 4/21/2026 |
| 1.2.23 | 111 | 4/14/2026 |
| 1.2.22 | 109 | 4/10/2026 |
| 1.2.21 | 112 | 4/10/2026 |
| 1.2.20 | 106 | 4/10/2026 |
| 1.2.19 | 104 | 4/9/2026 |
| 1.2.18 | 115 | 4/2/2026 |
| 1.2.17 | 111 | 4/1/2026 |
| 1.2.16 | 106 | 4/1/2026 |
| 1.2.15 | 111 | 3/31/2026 |
| 1.2.14 | 112 | 3/30/2026 |