1

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?

Steve Dunn
  • 21,044
  • 11
  • 62
  • 87

1 Answers1

1

Assuming you have set up your project for User Secrets, you simply have to call AddUserSecrets when 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...)

Steve Dunn
  • 21,044
  • 11
  • 62
  • 87