I'm serving my MVC app locally via localhost:5252 right now.
I'm trying to set up my app to test multi-tenancy by having both localhost and contoso.localhost point to my web app instance.
I set up my hosts file with the corresponding entry:
This can be accomplished by editing the applicationHost.config file
Visual Studio usually handles editing this file for you when you make configuration changes, but you can manually edit. Find the particular site you are working with and the following bindings should work:
<bindings> <binding protocol="http" bindingInformation="*:5252:localhost" /> <binding protocol="http" bindingInformation="*:5252:contoso.localhost" /> </bindings>
You can really change the port to anything you want so you could use 80 to save yourself some typing. Continue adding bindings to fill out your multi-tenancy as needed.
If you are looking for more information, I would recommend checking out Scott Hanselman's blog post on IIS Express & SSL.
With VS 2015 & .NET core, the applicationHost.config has moved to a directory based system of storing the configuration instead of a global configuration file. The new location is relative to your project:
The same editing principals apply to this file, but when using TFS source control VS does not edit the file when changing between branches as it did with the global file.
Regarding the wildcard comment for domains, wildcarding hostname isn't supported until IIS 10. Therefore, it may be supported in IIS Express 10, but probably not before.
The breakdown of the