Microsoft.FeatureManagement 4.6.0 Update

by AvlCodeMonkey Share

Microsoft released Feature Management 4.6.0 recently. Here's what's new.

Keyed Dependency Injection for Feature Variants

Previously, registering multiple implementations (variants) of a feature flag required complex custom resolution logic.

  • The Change: 4.6.0 introduces native support for keyed dependency injection.
  • The Benefit: You can now map individual service implementations directly to specific feature variants. .NET resolves the exact service implementation at runtime based on the active variant key, cleaning up architecture and removing boilerplate factory code.

Lazy On-Demand Instantiation

Before this update, applications managing numerous heavy-weight feature implementations often experienced overhead from pre-allocating memory and initializing unnecessary services.

  • The Change: The framework now supports lazy instantiation for variant services.
  • The Benefit: Services are only created at the exact moment the application requests them. This is ideal for microservices and cloud apps where different feature toggles use completely unique configurations, databases, or third-party APIs. If a feature flag is turned off, its underlying resources are never instantiated.

Consolidated Ecosystem Updates

To ensure alignment across the feature flagging toolset, updates were pushed simultaneously to multiple dependent packages: Microsoft.FeatureManagement.AspNetCore and Microsoft.FeatureManagement.Telemetry.ApplicationInsights.

Updating your core manager to 4.6.0 allows you to upgrade your ASP.NET Core middleware and Application Insights telemetry integrations seamlessly to the same version without dependency version conflicts. Read more at github.com/microsoft/FeatureManagement-Dotnet.