Open Closed

Customize TenantConfigurationProvider #7032


User avatar
0
lan.dang created
  • ABP Framework version: v8.1.0
  • UI Type: Angular
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hello, I take care project from Christope This solution works with ABP 7.0.0 https://support.abp.io/QA/Questions/1490/Adding-project-VoloAbpMultiTenancy-from-Github-into-ABP-solution But I got this error after upgrade ABP to 8.1.0 ArgumentException: The type 'Kwork.StaffApp.CustomSource.MyTenantConfigurationProvider' is not assignable to service 'Volo.Abp.Identity.IdentityUserManager'. How can I make it works? I tried to add but it does not solve the error context.Services.Replace( ServiceDescriptor.Transient<ITenantConfigurationProvider, MyTenantConfigurationProvider>() );

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

3 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    You can try this:

    [Volo.Abp.DependencyInjection.Dependency(ReplaceServices = true)]
    [ExposeServices(typeof(TenantConfigurationProvider), typeof(ITenantConfigurationProvider))]
    public class MyTenantConfigurationProvider : TenantConfigurationProvider
    {
        public MyTenantConfigurationProvider(
            ITenantResolver tenantResolver,
            ITenantStore tenantStore, 
            ITenantResolveResultAccessor tenantResolveResultAccessor) : 
            base(tenantResolver, tenantStore, tenantResolveResultAccessor)
        {
        }
    
        public override async Task GetAsync(bool saveResolveResult = false)
        {
            return await Task.FromResult(new TenantConfiguration(Guid.Empty, "dummy"));
        }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    lan.dang created

    Thank you, it worked

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    : )

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 09, 2026, 11:56
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.