-
Notifications
You must be signed in to change notification settings - Fork 119
Add option for no feature management section found #312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option for no feature management section found #312
Conversation
| options.RequireFeatureManagementSection = false; | ||
| }); | ||
|
|
||
| services.AddSingleton<IFeatureDefinitionProvider>(sp => new ConfigurationFeatureDefinitionProvider( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a need for FeatureManagementOptions to be updated. In fact it's dangerous. If IFeatureDefinitionProvider that is created with the inline configuration is not the one that ends up being used (multiple addfeaturemanagmeent calls), then the options won't match the added service.
I think it needs to be
services.TryAddSingleton<IFeatureDefinitionProvider>(sp =>
new ConfigurationFeatureDefinitionProvider(
configuration,
sp.GetRequiredService<ILoggerFactory>())
{
UseTopLevelConfiguration = true
});
Resolve #308