Learn More, Pay Less!
Limited Time Offer!
Open Closed

ISettingManager is not registered #6842


User avatar
1
themisoft created

Hello, I'm trying to inject the "ISettingManager" into a .razor page: When i do it this way, i get the error, that the Service is not registered:

It worked in a non-tiered Solution, that i was testing a few months ago.

What i tried:

  • Adding the Service manually (via. AddScoped, AddSingelton etc.) in the Blazor Module "ConfigureServices" Method. This led to more complex Errors
  • Adding [DependsOn(typeof(AbpSettingManagementDomainModule))]. This also led to more complex Errors.
  • Removing the ISettingManager removes the Error, the ISettingProvider works fine.

What this code is supposed to to do:

  • Saves a Filepath.

  • ABP Framework version: v8.0.2
  • UI Type: Blazor Server
  • Database System:PostgreSQL
  • Tiered Blazor Server (Auth,Blazor,ApiHost Server): yes

2 Answer(s)
  • User Avatar
    0
    rsg160 created

    Same issue here

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi SettingManager is a domain service and you cannot use it directly from the Blazor UI.

    You'll need to access it by using application services.You can create your own ApplicationService, inject ISettingManager to it and provide endpoints that uses Setting Manager.

    See the email settings example: https://github.com/abpframework/abp/blob/44a070b3ccbe45ab8e0b51542a56cdf313611739/modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo/Abp/SettingManagement/EmailSettingsAppService.cs#L18

    If you use MVC or Blazor Server with Single layer option, technically possible to use in UI layer, but it's not recommended to use domain service directly in the UI-layer

Made with ❤️ on ABP v9.2.0-preview. Updated on February 07, 2025, 05:40