I have a project that is written on the top of Asp.NET 5/Core using Visual Studio 2019.
My project has multi-tenancy support and need to be able to map multiple local domains to the project to test out multi-tenancy.
How can I bind a second local domain to point to the same running host? I added tenant1.website
and tenant2.website
in the .hosts
file like so
127.0.0.1 tenant1.website
127.0.0.1 tenant2.website
I tried to modify the .vs\PrjectName\config\applicationhost.config
and added new binding like this
<site name="ProjectName.Web" id="2">
<application path="/" applicationPool="ProjectName.Web AppPool">
<virtualDirectory path="/" physicalPath="E:\ProjectName\ProjectName.Web" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:37893:localhost" />
<binding protocol="https" bindingInformation="*:44356:localhost" />
<binding protocol="http" bindingInformation="*:37893:tenant1.website" />
<binding protocol="https" bindingInformation="*:44356:tenant1.website" />
<binding protocol="http" bindingInformation="*:37893:tenant2.website" />
<binding protocol="https" bindingInformation="*:44356:tenant2.website" />
</bindings>
</site>
But, when I go to https://tenant1.website:44356
I get the following error
This site can’t be reached
How can I correctly bind tenant1.website
and tenant2.website
to my locally running app using IIS Express?