azure-docs
azure-docs copied to clipboard
Non-existent extension method
The second code example is using the extension method
services.AddFeatureManagement(options =>
{
options.UseConfiguration(Configuration.GetSection("MyFeatureFlags"));
});
But with a training, I do not found the method AddFeatureManagement. Neither in the api documentation https://docs.microsoft.com/en-us/dotnet/api/microsoft.featuremanagement.servicecollectionextensions.addfeaturemanagement?view=azure-dotnet-preview#Microsoft_FeatureManagement_ServiceCollectionExtensions_AddFeatureManagement_Microsoft_Extensions_DependencyInjection_IServiceCollection_Microsoft_Extensions_Configuration_IConfiguration_
Does this method is still existing ?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: fa18f095-325a-628d-9c05-551c09f7392e
- Version Independent ID: 5db3af04-a314-24fd-6202-772aaa62a28d
- Content: Tutorial for using feature flags in a .NET Core app
- Content Source: articles/azure-app-configuration/use-feature-flags-dotnet-core.md
- Service: azure-app-configuration
- GitHub Login: @lisaguthrie
- Microsoft Alias: lcozzens
@worming004 Thanks for the question! We're investigating this and will get back to you shortly.
@worming004 - My understanding is that you are not able to consume the method services.AddFeatureManagement
I had installed the Microsoft.FeatureManagement Nuget Package
Project ->Manage Nuget Packages -> Browse -> Microsoft.FeatureManagement
Also, I had added the reference to the same.
With the above steps, I was able to make use of the method.
Wanted a quick understanding whether you followed the above steps and encountered the issue. Also, please feel free to let me know if I had missed anything or you are doing differently at your end.
Hello @Svijay-msft ,
You are near of the issue I encounter. services.AddFeatureManagement(); is working well. And I successfully installed Microsoft.FeatureManagement Nuget package.
But the method with the Action is not found.
Maybe I miss another Nuget package ?
#reassign:lisaguthrie
@lisaguthrie
One of the overload of AddFeatureManagement method is expecting IConfiguration object.
Reference : AddFeatureManagement(IServiceCollection, IConfiguration)
In the example in the documentation to read from a different section we are not passing IConfiguration object. We are passing an Action.
services.AddFeatureManagement(options => { options.UseConfiguration(Configuration.GetSection("MyFeatureFlags")); });
@worming004 I have assigned the issue to the content author to review further and update the document as appropriate.
The document is still not updated and I am still getting the same error. Also, does anyone have a working example for method
public static IFeatureManagementBuilder AddFeatureManagement(this IServiceCollection services, IConfiguration configuration);
?
@lisaguthrie
One of the overload of AddFeatureManagement method is expecting IConfiguration object.
Reference : AddFeatureManagement(IServiceCollection, IConfiguration)
In the example in the documentation to read from a different section we are not passing IConfiguration object. We are passing an Action.
services.AddFeatureManagement(options => { options.UseConfiguration(Configuration.GetSection("MyFeatureFlags")); });
Can you please provide an example of the second overload method of AddFeatureManagement
which is using IConfiguration
?
#reassign:AlexandraKemperMS
@AlexandraKemperMS - can you take a look at this one?
#close
The doc has been fixed.
Thanks !