Base solution for your next web application
Open Closed

Configuration.Modules.AbpWebCommon().MultiTenancy.DomainFormat problem #8025


User avatar
0
dev1_premierpoint created

In my testing of the Phonebook demo application, I have been unable to get automatic subdomain-based tenant resolution to work in either a staging or production environment.

I thought it would just work automatically, but it didn't. So, I read some more on this page in the Abp documentation:

https://aspnetboilerplate.com/Pages/Documents/Multi-Tenancy#switching-between-host-and-tenants

Based on that page, I added this line to my PhoneBookDemoCoreModule.cs file:

Everything builds fine with that line, but then after publishing the Mvc project to my staging and production web servers, I get this error when trying browse to the application:

<br> This is how I have my appsettings.staging.json and appsettings.production.json files configured:

If I remove the Configuration.Modules.AbpWebCommon().MultiTenancy.DomainFormat line from the module and re-publish, everything works fine again, in terms of multitenancy - just no automatic tenant identification based on subdomain.


1 Answer(s)
  • User Avatar
    0
    dev1_premierpoint created

    I figured out how to get past this error, but the addition of the MultiTenancy.DomainFormat property does not seem to make any difference in getting the application to resolve tenant based on subdomain. So, I still need help with figuring that out.

    For anyone that runs across this ticket later on, here is what my problem was when getting the ComponentNotFoundException:

    I need to to a type to the Depends On attribute at the top of the module. I needed to add this:

    which the required this:

    using Abp.Web

    Now the application will load again from the staging server.  But, still no success in getting tenant resolution via subdomain.

    I'm going to open another ticket on the subdomain resolution problem since that wasn't the primary subject of this ticket.