I've got an ASPNET Core web app (.NET 6). I have User Secrets enabled and Feature Management enabled.
I would like to override some flags in my user secrets. However, by default, Feature Management reads from the FeatureManagement section of config, but doesn't read from user secrets.
How do I get FeatureManagement to read from user secrets as well as other config sources?
Assuming you have set up your project for User Secrets, you simply have to call
AddUserSecretswhen building your configuration.This is automatically done for you when using
WebHost.CreateDefaultBuilder, but isn't if you manually initialise the builder (several hours could be lost if you forget this important fact - ask me how I know...)