# Copyright (c) 1993-1999 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host127.0.0.1 localhost//// 这是hosts里面的类容,貌似已经映射了啊!! 还是打不开!
我没用IIS。。 就是用VS附带的 ASP.net development server。。我将 hosts里的 127.0.0.1 localhost 改为 127.0.0.1 local 然后运行的时候输入 http://local:1343/defalut.aspx 也能顺利运行。。 为什么啊? 用localhost打死不行啊! 我那个ASP.net development server默认的就是localhost,难道每次都要改啊?
C:\WINDOWS\system32\drivers\etc\hosts
看看有没有做localhost的映射。记得多结贴
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host127.0.0.1 localhost//// 这是hosts里面的类容,貌似已经映射了啊!! 还是打不开!
127.0.0.1 localhost
10楼的, hosts文件就是那样的!还是只能通过127.0.0.1访问!
localhost 无法访问!
那个人看错了,他以为你是用IIS。
然后运行的时候输入 http://local:1343/defalut.aspx 也能顺利运行。。
为什么啊?
用localhost打死不行啊!
我那个ASP.net development server默认的就是localhost,难道每次都要改啊?
2、打开http://127.0.0.1 看是否能访问IIS的默认网页,能访问则说明IIS已经成功安装到电脑上,可能是无法解析localhost;
3、开始--命令(cmd)--ping localhost,看是否能ping通,从127.0.0.1上返回信息,如果成功则说明可以解析localhost;
4、如果上一步不成功,则用记事本打开C:\WINDOWS\system32\drivers\etc\hosts文件,看里面是否有包含:127.0.0.1 localhost ,如果没有则将其添加进去,再查看能否访问localhost。
5、尝试将网站的主目录指向另一个目录或新建一个虚拟目录,并在该新目录创建一个新的网页文件,如index.html,然后将其加到默认网站的"文档"项中作为默认访问的网页,重新输入网址:http://localhost,看否能访问。
6、还是不行的话将IIS卸载掉,重新再安装一次。参考:http://topic.csdn.net/u/20080121/21/a2c26049-1382-4cda-ae5b-ecf3d0e7668c.html
就用VS自带的 ASP.net develoment server 来调试程序。
出现冲突的异常不奇怪,里面还有个sln的东东
建议,在IIs里建虚拟目录
就不会出现此类问题了