Dear Support
I have changed the "Website Root Address" to {TENANCY_NAME}.mydomain.com in Host Settings.
I have also setup the wildcard hostname on Azure *.mydomain.com.
When I navigate to the site <a class="postlink" href="http://www.mydomain.com">http://www.mydomain.com</a> i can see the front end website.
When i click on the login button, I get the following error
Server Error in '/' Application.
There is no tenant defined with name www
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Abp.UI.UserFriendlyException: There is no tenant defined with name www
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[UserFriendlyException: There is no tenant defined with name www]
is this functionality normal, am i supposed to create a www tenant to access the back end?
Should i rename the default tenant to www?
31 Answer(s)
-
0
I have created a similar class like DomainTenantResolverContributor and add the resolver in the Web Module in the MVC project, but when debug it the HttpContext is null
var httpContext = _httpContextAccessor.HttpContext; if (httpContext == null) { return null; }
Did you get the similar exception before?
-
0
Hi,
We didn't get a similar exception before but we helped a customer recently for subdomain problem with angular2 project. I think you might have the same case.
The problem was the / character at the end of WebSiteRootAddress value in host project's config. So you need to use a config like this.
"WebSiteRootAddress": "http://{TENANCY_NAME}.mydomain.com"
Dont put a / at the end of WebSiteRootAddress value.
For DomainTenantResolveContributor, are you adding it in PreInitialize method of your module ?
Thanks.
-
0
Yes, I put it in the PreInitialize method of Web Module in MVC project, but not remove "/" at the end of the WebSiteRootAddress, when debug it on dev machine sometimes it throw HttpContext is null.
But, I deployed this changes to production, it works as expected, really a little strange. I also extended some customized code to match a customized Host per tenant, code like below:
//Find independency hosts var tenants = from t in _tenantRepository.GetAllList() select t; string[] hosts = null; foreach (var item in tenants) { if (!item.Hosts.IsNullOrEmpty()) { if (!item.Hosts.Contains(",")) { hosts = new string[1]; hosts[0] = item.Hosts; } else { hosts = item.Hosts.Split(',').Length > 0 ? item.Hosts.Split(',') : null; } if (hosts.Count() > 0) { foreach (var host in hosts) { if (host.ToLower() == domainFormat.ToLower()) { Logger.Info("TenancyName:" + item.TenancyName); return item.Id; } else { continue; } } } } }
Is the DomainTenantResolverContributor check each request? If that, I need to cache the tenant results from repository.
-
0
Hi,
Is the DomainTenantResolverContributor check each request?
Yes, you can use ITenantStore as we did in DomainTenantResolverContributor.
-
0
I hosted Core API on service.abc.com without wildcard and Angular App hosted on {Tenant_Name}.abc.com with wildcard.
As per your provided configuration, Tenant name is also include in "ServerRootAddress": "http://{TENANCY_NAME}.service.abc.com"
do we also need wildcard for the Core API ?
Please give me the solution for this I have only on wildcard and IP server, how can i implement multi tenancy ?
-
0
Hi,
We don't have much information on this. Since you are using a second level subdomain, it is better to ask this to a SSL certificate provider. I think they can give you a better answer.
Thanks.