azure-docs icon indicating copy to clipboard operation
azure-docs copied to clipboard

Non-existent extension method

Open worming004 opened this issue 4 years ago • 11 comments

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.

worming004 avatar Aug 11 '20 06:08 worming004

@worming004 Thanks for the question! We're investigating this and will get back to you shortly.

BhargaviAnnadevara avatar Aug 11 '20 06:08 BhargaviAnnadevara

@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.

image

With the above steps, I was able to make use of the method.

image

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.

Svijay-msft avatar Aug 11 '20 13:08 Svijay-msft

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. image

Maybe I miss another Nuget package ?

worming004 avatar Aug 11 '20 16:08 worming004

#reassign:lisaguthrie

Svijay-msft avatar Aug 12 '20 12:08 Svijay-msft

@lisaguthrie

One of the overload of AddFeatureManagement method is expecting IConfiguration object.

image

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")); });

Svijay-msft avatar Aug 12 '20 13:08 Svijay-msft

@worming004 I have assigned the issue to the content author to review further and update the document as appropriate.

Svijay-msft avatar Aug 12 '20 17:08 Svijay-msft

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); ?

nitink08 avatar Jan 08 '21 17:01 nitink08

@lisaguthrie

One of the overload of AddFeatureManagement method is expecting IConfiguration object.

image

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?

nitink08 avatar Jan 08 '21 17:01 nitink08

#reassign:AlexandraKemperMS

lisaguthrie avatar Jan 09 '21 01:01 lisaguthrie

@AlexandraKemperMS - can you take a look at this one?

lisaguthrie avatar Jan 09 '21 01:01 lisaguthrie

#close

The doc has been fixed.

zhenlan avatar Dec 02 '22 16:12 zhenlan

Thanks !

worming004 avatar May 11 '23 05:05 worming004