Base solution for your next web application
Open Closed

Tenant Feature Management #8896


User avatar
0
MASITEK_ASPNETZERO created

Hi, I am trying to add a simple boolean feature that can be turned on/off per tenant. I have added the feature to the AppFeatureProvider like this:

context.Create(
    "Receipt", 
    defaultValue: "true", 
    displayName: L("Receipt"), 
    inputType: new CheckboxInputType() 
 );

This code is in the AppFeatureProvider class in the SetFeatures() function that were already there.
I then added this code to the MyProjectWebModule class in the App_Start folder:

Configuration.Features.Providers.Add<AppFeatureProvider>();

Now when I run the application I get the error: Abp.AbpException: "There is already a feature with name Receipt" It doesn't matter what I put as the name of the feature, I still get the error.
What am I doing wrong? Thanks.

ASP.NET MVC 5.x & AngularJs 1.x (v8.4.0) VS 2019 (16.5.4) Win 10 (1909)


1 Answer(s)
  • User Avatar
    0
    MASITEK_ASPNETZERO created

    Ok so I found the issue, the line of code "Configuration.Features.Providers.Add<AppFeatureProvider>();" is already in the CoreModule by default.