DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
Redmond desk4 min

Microsoft Feature Management: Key Quirks .NET Developers Should Know

Feature flags can surprise .NET developers when filter defaults, DI lifetimes, targeting context, or request-level snapshots shape evaluation. Learn what to check.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When a feature flag behaves differently than expected in ASP.NET Core, the cause is often how the library evaluates filters, chooses a contextual filter, or registers services—not a defective flag. Knowing these documented behaviors makes it easier to choose the right registration, supply the right context, and keep flag decisions consistent where needed.

Why can a feature flag behave differently than expected?

A feature’s state is not necessarily a single Boolean stored in configuration. Evaluation can depend on the feature definition’s status, its requirement type, the filters attached to it, and the context supplied by the caller. Microsoft documents these as parts of feature management behavior; they are important to check before treating an unexpected result as a bug.

As an Amazon Associate I earn from qualifying purchases.

Filter requirements default to Any

By default, a feature is enabled when any applicable filter says it should be enabled. The FeatureDefinition.RequirementType default is Any. If the feature should be enabled only when every condition is satisfied, configure the requirement as All deliberately. See Microsoft’s FeatureDefinition API reference and .NET feature flag management guide.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Disabled status overrides the filters

A feature definition with Status = Disabled remains disabled regardless of its filters. When a filter appears to approve a feature that is still off, check the definition status as well as the filter configuration.

Choose the service lifetime that matches your filters

AddFeatureManagement registers feature-management services, including filters, as singletons by default. That is suitable for many applications, but a singleton filter must not depend on a request-scoped service. If a filter needs scoped state, Microsoft directs developers to use AddScopedFeatureManagement, which registers feature-management services as scoped instead.

For example, if a custom filter injects a scoped tenant or request-context service, register feature management in the same scope:

services.AddScopedFeatureManagement();

Use this conditionally: an application whose filters do not consume scoped dependencies does not need scoped registration merely because it uses ASP.NET Core. Review the Microsoft .NET feature flag management guide for the registration details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand which filter an evaluation selects

Feature evaluation traverses a feature’s filters until one indicates that the feature should be enabled; it does not inherently require every filter to pass. The requirement type determines whether the configured filters are combined with Any or All. This distinction matters when multiple filters are attached: adding another filter under the default Any can create another way for the feature to turn on.

Contextual filters use the supplied context type

A contextual filter declares the type of context it accepts, and contextual evaluation supplies that context through IsEnabledAsync<TContext>. If a non-contextual filter and contextual filters share an alias, the library selects the matching implementation according to the supplied context. With no context, a matching non-contextual filter is selected when present; when the supplied context matches a contextual filter, that contextual filter is selected. Only one applicable filter can match a given context type.

A filter type cannot implement multiple feature-filter interfaces: doing so causes an ArgumentException. If an alias seems to select the wrong implementation or evaluation throws, check the interface implemented by the filter, the context type passed by the caller, and whether more than one applicable filter matches that type. These rules are documented in the .NET feature flag management guide.

Targeting depends on where evaluation runs

AddFeatureManagement adds the built-in PercentageFilter, TimeWindowFilter, and ContextualTargetingFilter. The non-contextual TargetingFilter is registered separately by calling .WithTargeting(). In web applications, the default targeting-context accessor uses HttpContext.User: the user ID comes from Identity.Name, and groups come from role claims. If an application uses a different identity model, it may need a custom targeting-context accessor.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Background jobs, console applications, and other code without ambient HTTP context should not assume a web user is available. Pass the targeting context explicitly to contextual evaluation instead. This makes the identity or audience used by the decision visible at the call site rather than dependent on an HTTP request being present.

Time-window recurrence needs both bounds

The time-window filter accepts start and end bounds. A recurring window requires both Start and End; the documented recurrence patterns include daily and weekly schedules. A start-only or end-only window should not be configured with the expectation that it will recur. Filter, targeting, and time-window behavior is covered in Microsoft’s .NET guide.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use snapshots for request-level consistency

IFeatureManagerSnapshot provides a snapshot of feature state to ensure consistency across a given request. It is useful when multiple evaluations during one request should use a consistent view of feature state. Microsoft’s API description does not promise the same value across separate requests, across application instances, or for an arbitrary period. Treat it as a request-level consistency tool, not a distributed or long-lived cache. See the IFeatureManagerSnapshot API reference.

Match the feature-management approach to the job

Approach What it controls Useful when
Switch On/off availability You need a straightforward control for enabling or disabling a feature.
Rollout Exposure by percentage, audience, or schedule You want to introduce a feature gradually or limit it to selected users or times.
Experiment Variants assigned for comparison You want to compare alternatives rather than only enable or disable one implementation.

These are different operational purposes, not interchangeable names for the same flag. Microsoft’s overview describes feature management as separating feature release from code deployment, and documents Azure App Configuration as a centralized repository for feature flags that can be managed separately from application deployment. It also supports evaluation telemetry. See Understand feature management using Azure App Configuration and the Feature Management Overview.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check platform support before relying on a feature

Feature-management capabilities are not necessarily at the same release status across .NET, Java, JavaScript, Python, Go, and Spring. In Microsoft’s platform matrix last updated February 4, 2026, .NET entries for targeting, time windows, custom filters, AND/OR requirement type, variants, telemetry, and Application Insights integration are marked GA; recurring time windows are also marked GA for .NET. Check the current platform matrix for the platform and capability you plan to use, because availability can change.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.