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.
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.
#1 Best Overall
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:
Rank #2
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.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →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.
Rank #3
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.
Rank #4
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.
Recommended Free Tools
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.
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.
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.
Quick Recap
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.




