简体   繁体   English

127.0.0.1无法正常工作,但localhost可以正常工作

[英]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.

相关问题 C# Web - localhost:port 有效,127.0.0.1:port 无效 - C# Web - localhost:port works, 127.0.0.1:port doesn't work 自定义http服务可以很好地响应本地IP地址,但不能响应localhost或127.0.0.1 - Custom http service responds fine to local IP address but NOT to localhost or 127.0.0.1 为什么这个布尔值在自定义 function 中不起作用,但在更新 function 中却能正常工作? - Why does this bool not work in a custom function, but works fine in the update function? x:Bind在button_click上不起作用,在MainPage()中可以正常工作 - x:Bind does not work on button_click, works fine in MainPage() WCF Rest Web服务在localhost上运行,但在服务器上不运行 - WCF Rest Webservice works on localhost but does not work on server Facebook Connect注销可以在localhost上正常运行,但不能在服务器上运行 - Facebook Connect Logout works fine in localhost but not on server 为什么相同的PHP UnityWebRequest在plesk服务器上不起作用,但在我的本地主机上起作用? - Why does the same php UnityWebRequest does not work on plesk server but works on my localhost? Google Map Direction Api在本地工作正常,但在服务器上部署后无法正常工作 - Google Map Direction Api Works Fine Locally but does not work properly when deployed on Server GridView:在服务器上运行时数据库错误,在本地主机上运行正常 - GridView: Database error when running on server, works fine on localhost 为什么会话变量在登台服务器中丢失,但在localhost中工作正常? - Why a session variable lost in staging server, but works fine in localhost?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM