Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

Implementing Feature Management in .NET: The Lazy Way

Microsoft did the hard work so you don't have to. The Microsoft.FeatureManagement library integrates directly with .NET's configuration and dependency injection systems, which means you can get feature flags working with minimal code and a solid foundation. For the full documentation, check out the Microsoft Feature Management documentation . Let's get this thing running. Installation Add the…

Microsoft has made it easy to implement feature management in .NET applications with the Microsoft.FeatureManagement library. This library seamlessly integrates with .NET's configuration and dependency injection systems, allowing developers to set up feature flags with minimal code. To get started, simply install the NuGet package Microsoft.FeatureManagement.AspNetCore and register the feature management services in your Program.cs file using builder.Services.AddFeatureManagement();.

Feature flags can be configured in the appsettings.json file, with flag names as strings and values as booleans. Checking a flag in code is as simple as injecting the IFeatureManager and using the IsEnabledAsync method to determine if the feature should be enabled.

For more complex use cases, the library supports feature filters such as percentage rollouts, time windows, and user targeting. For example, you can enable a feature for a specific percentage of requests by specifying the EnabledFor parameter with a Percentage type. Additionally, the library includes Razor tag helpers for conditionally rendering markup based on feature flags, providing a clean and readable way to incorporate feature management into Razor-based UIs.

While rolling your own feature flag system may seem like a good learning exercise, it's often not worth the time and effort. Microsoft's library already provides a solid foundation with configuration, dependency injection, feature filters, and percentage rollouts. If you find yourself needing to toggle features on and off frequently, a dedicated feature flag management UI like FeatureFlags.app can be a more efficient solution.

By leveraging existing tools, developers can save time and focus on building the actual features instead of spending days setting up a flag system.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

RDS High Availability and credential rotation without downtime

I got an AWS question and implemented it to make sure that the option is correct. A critical financial application runs on RDS for PostgreSQL.

  • Amazon RDS Multi-AZ deployment ensures high availability with <60-second failover.
  • AWS Secrets Manager automates 30-day database credential rotation without downtime.
  • RDS Proxy maintains database connections, enabling seamless credential updates.

You Can Finally Buy a Fairphone In the US

An anonymous reader quotes a report from Wired: Your iPhone, SamsungGalaxy, andGoogle Pixel have a 1-year warranty. Unless you cough up extra dough for an extended service plan, you'll pay a hefty fee…

  • Fairphone now available for purchase in the US
  • Features modular design with 12 replaceable parts
  • Priced at $650, available on Amazon and Fairphone.com

More from Tuesday 18 August →