[英]127.0.0.1 does not work, but localhost works fine
What could be the reason that 127.0.0.1 is not working? 127.0.0.1无法正常工作的原因可能是什么?
localhost
works fine localhost
工作正常
In file: 在文件中:
C:\Windows\System32\drivers\etc\hosts
There is a records: 有一条记录:
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
I am building a .NET application with SOAP 我正在使用SOAP构建.NET应用程序
Project URL http://localhost:1399/Services
项目URL
http://localhost:1399/Services
I will add that if I change Project Url to 127.0.0.1 , it also doesn't work 我要补充一点,如果我将Project Url更改为127.0.0.1 ,那么它也不起作用
EDIT: 编辑:
Note when I try to set another Project URL
请注意,当我尝试设置另一个
Project URL
Enter the catalog: 输入目录:
.vs\YourApp\config\
Edit file applicationhost.config 编辑文件applicationhost.config
Find the line: 找到这行:
<binding protocol="http" bindingInformation="*:1399:localhost" />
Replace it with 替换为
<binding protocol="http" bindingInformation="*:1399:*" />
*
will make it accept everything so you can use a different IP (eg in the android emulator it can be 10.0.2.2
or in the browser 127.0.0.1
) *
将使其接受所有内容,因此您可以使用其他IP(例如,在android仿真器中,它可以是10.0.2.2
或在浏览器127.0.0.1
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.