IIS Express is a mini version of IIS that is capable of supporting all web development tasks, but there are flaws in this design, such as the ability to access our applications only through localhost:<port>, which looks a bit uncomfortable, Fortunately we can change the default configuration and use a custom hostname to access the site program running on IIS Express.
1. Create a new ASP. NET Core Web application
If you do not make any changes, the first run will be run using the Localhost:<port> method, The Config folder is created under the. vs folder, and a applicationhost.config is generated under the Config folder, which is the startup configuration file for IIS Express. The Note:.vs folder is hidden by default and you need to display it.
2. Right-click on the item → properties, select debug Options, modify the app URL
can also be modified directly in the Launchsettings.json file
After the modification is complete, we return to the IIS Express startup profile ApplicationHost.config, and we find that a binding node is automatically more
3, modify the Hosts file, located in C:\Windows\System32\drivers\etc\hosts, open it as an administrator, and add the following content
127.0.0.1 Www.oneaspnet.dev
Run the program again
For legacy ASP. NET Projects
It is strange that after saving the add binding node is not added automatically in the IIS Express configuration file, we need to add it manually.
Whether a new generation of ASP. NET Core or traditional ASP. NET can be accessed in the custom domain name in IIS Express, does it look sour?
Net Core IIS Express in