-
Notifications
You must be signed in to change notification settings - Fork 121
Description
I have registered the custom filter for one of the features like the code below
// Initialize Feature Management var serviceCollection = new ServiceCollection(); serviceCollection.AddSingleton<IConfiguration>(configuration) .AddFeatureManagement() .AddFeatureFilter<DeviceFilter>();
and have other features which require the target filter which I didn't register the filter so I got the below exception
The feature filter 'Microsoft.Targeting' specified for feature 'device_health_enabled2' was not found.
Then I added PercentageFilter and TargetingFilter in the code below
// Initialize Feature Management
var serviceCollection = new ServiceCollection();
serviceCollection.AddSingleton(configuration)
.AddFeatureManagement()
.AddFeatureFilter()
.AddFeatureFilter()
.AddFeatureFilter();
Now I am getting the below exception
Unable to resolve service for type 'Microsoft.FeatureManagement.FeatureFilters.ITargetingContextAccessor' while attempting to activate 'Microsoft.FeatureManagement.FeatureFilters.TargetingFilter'.
Could you please help me resolve the above exception?
Also, I would like to register the ignore missing filter option but couldn't find a way to do it. I am using the dependency injection in the WPF client application
https://github.com/microsoft/FeatureManagement-Dotnet#missing-feature-filters
Thanks,
Sathishkumar