本地运行时改变本地主机域名 [英] change localhost domain when running locally
问题描述
我在使用Visual Studio为我的IDE正在开发一个.NET Web应用程序。
I am using Visual studio as my IDE is developing a .net web application.
我用我的本地IIS7的Web服务器来运行应用程序。
I use my local IIS7 web server to run the application.
它运行URL下 - > 的http://本地主机/ AppName的/
It runs under the url -> http://localhost/AppName/
我想这个变化 - > http://localhost.appname.com/AppName/
I want the change this to -> http://localhost.appname.com/AppName/
我添加了以下主机文件条目 127.0.0.1 localhost.appname.com
I have added the following host file entry 127.0.0.1 localhost.appname.com
这是说现在我可以通过 http://localhost.appname.com/AppName/访问网站一>像我想要的。
This now mean I can access the site via http://localhost.appname.com/AppName/ like I wanted.
我有一个问题,但如果我运行通过开始调试(F5)的网站,该网站运行在域 HTTP ://本地主机/ AppName的/ 。
I have one issue though, if I run the site via "Start Debugging" (F5), the site runs in the domain http://localhost/AppName/ .
做什么样的变化,我需要对Web应用程序得到它开始与域的http://本地主机.appname.com / AppName的/
What changes do I need to make to the web application to get it to start with domain http://localhost.appname.com/AppName/
推荐答案
启动页面可以通过项目属性=>网络设置。通常情况下,我觉得最好的办法是什么也不做(我会调用我想在浏览器中的网页我想手动)
The startup page can be set via project properties => web. Typically I find the best option is "do nothing" (I'll invoke the page I want in the browser I want manually)
这篇关于本地运行时改变本地主机域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!