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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dosaic.Plugins.Management.Unleash" Version="1.2.30" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dosaic.Plugins.Management.Unleash" Version="1.2.30" />
                    
Directory.Packages.props
<PackageReference Include="Dosaic.Plugins.Management.Unleash" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Dosaic.Plugins.Management.Unleash --version 1.2.30
                    
#r "nuget: Dosaic.Plugins.Management.Unleash, 1.2.30"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Dosaic.Plugins.Management.Unleash@1.2.30
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Dosaic.Plugins.Management.Unleash&version=1.2.30
                    
Install as a Cake Addin
#tool nuget:?package=Dosaic.Plugins.Management.Unleash&version=1.2.30
                    
Install as a Cake Tool

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:

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 propagationUnleashMiddlware ([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 integrationUnleashFeatureDefinitionProvider 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed