Dosaic.Plugins.Management.Unleash
1.2.30
dotnet add package Dosaic.Plugins.Management.Unleash --version 1.2.30
NuGet\Install-Package Dosaic.Plugins.Management.Unleash -Version 1.2.30
<PackageReference Include="Dosaic.Plugins.Management.Unleash" Version="1.2.30" />
<PackageVersion Include="Dosaic.Plugins.Management.Unleash" Version="1.2.30" />
<PackageReference Include="Dosaic.Plugins.Management.Unleash" />
paket add Dosaic.Plugins.Management.Unleash --version 1.2.30
#r "nuget: Dosaic.Plugins.Management.Unleash, 1.2.30"
#:package Dosaic.Plugins.Management.Unleash@1.2.30
#addin nuget:?package=Dosaic.Plugins.Management.Unleash&version=1.2.30
#tool nuget:?package=Dosaic.Plugins.Management.Unleash&version=1.2.30
Dosaic.Plugins.Management.Unleash
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.
Installation
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 check
Configuration
The 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 |
Usage
Checking a feature flag in code
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);
}
}
Guarding a controller or action with [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");
}
MVC Razor views
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>
Conditional middleware
Gate an entire middleware on a feature toggle:
app.UseMiddlewareForFeature<AnalyticsMiddleware>("analytics-tracking");
Conditional MVC filters
Register an MVC action filter that is only active when a toggle is enabled:
services.AddMvc(options =>
{
options.Filters.AddForFeature<AuditFilter>("audit-logging");
});
Toggle types
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" |
Features
Automatic Unleash context propagation —
UnleashMiddlware([Middleware(50)]) builds anUnleashContextper request, populatingUserId(fromHttpContext.User.Identity.Name),AppName,CurrentTime,RemoteAddress, and (optionally)SessionIdwhen session middleware is registered.Microsoft.FeatureManagementintegration —UnleashFeatureDefinitionProviderexposes all Unleash toggles asFeatureDefinitioninstances, andUnleashFilter([FilterAlias("Unleash")]) evaluates them via the Unleash client, makingIFeatureManagerthe single API for all feature checks.Disabled feature handler — when a
[FeatureGate]-protected endpoint is accessed but the flag is off,FeatureNotEnabledDisabledHandlerraises aNotFoundDosaicException, resulting in a404response.Health check — registers a readiness URL health check against
{apiUri}/healthunder the nameunleash.OpenTelemetry metrics — emits four counters automatically:
Metric Description dosaic_unleash_plugin_impressions_totalNumber of impression events (labelled by featureName,enabled)dosaic_unleash_plugin_errors_totalNumber of Unleash client error events dosaic_unleash_plugin_toggleUpdates_totalNumber of toggle cache refresh events dosaic_unleash_plugin_unleash_filter_calls_totalNumber of UnleashFilterevaluations (labelled byfeatureName,isEnabled)Structured logging — impression events are logged at
Debug, toggle updates atInformation, and errors atErrorlevel.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- Chronos.Abstractions (>= 2.0.24)
- Dosaic.Hosting.Abstractions (>= 1.2.30)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Configuration (>= 10.0.7)
- Microsoft.Extensions.DependencyInjection (>= 10.0.7)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Http (>= 10.0.7)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.7)
- Microsoft.FeatureManagement (>= 4.5.0)
- Microsoft.FeatureManagement.AspNetCore (>= 4.5.0)
- Unleash.Client (>= 5.6.1)
- Vogen (>= 8.0.5)
- YamlDotNet (>= 17.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.30 | 96 | 5/7/2026 |
| 1.2.29 | 84 | 5/5/2026 |
| 1.2.28 | 98 | 4/30/2026 |
| 1.2.27 | 96 | 4/29/2026 |
| 1.2.26 | 94 | 4/29/2026 |
| 1.2.25 | 102 | 4/27/2026 |
| 1.2.24 | 91 | 4/21/2026 |
| 1.2.23 | 100 | 4/14/2026 |
| 1.2.22 | 103 | 4/10/2026 |
| 1.2.21 | 105 | 4/10/2026 |
| 1.2.20 | 98 | 4/10/2026 |
| 1.2.19 | 95 | 4/9/2026 |
| 1.2.18 | 105 | 4/2/2026 |
| 1.2.17 | 104 | 4/1/2026 |
| 1.2.16 | 96 | 4/1/2026 |
| 1.2.15 | 104 | 3/31/2026 |
| 1.2.14 | 105 | 3/30/2026 |
| 1.2.13 | 98 | 3/26/2026 |
| 1.2.12 | 98 | 3/24/2026 |
| 1.2.11 | 105 | 3/17/2026 |