I was checking the official documentation from Microsoft and it states that the FeatureGate attribute can be used to control whether a whole controller class or a specific action is enabled. I've installed the Microsoft.Azure.AppConfiguration.AspNetCore 4.2.1 and even 4.3.0-preview but I can't find it:
using Microsoft.FeatureManagement.Mvc;//doesn't recognize .Mvc it recognizes up to Microsoft.FeatureManagement
[FeatureGate(MyFeatureFlags.FeatureA)]//doesn't recognize FeatureGate either
FeatureGateAttribute
is an API for ASP.NET Core applications. It's not included in the base feature management package (Microsoft.FeatureManagement
). You need to install the Microsoft.FeatureManagement.AspNetCore
package.
Instructions can be found at https://learn.microsoft.com/en-us/azure/azure-app-configuration/quickstart-feature-flag-aspnet-core?tabs=core5x#connect-to-an-app-configuration-store