簡體   English   中英

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

[英]127.0.0.1 does not work, but localhost works fine

127.0.0.1無法正常工作的原因可能是什么?

localhost工作正常

在文件中:

C:\Windows\System32\drivers\etc\hosts

有一條記錄:

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost

我正在使用SOAP構建.NET應用程序

項目URL http://localhost:1399/Services

我要補充一點,如果我將Project Url更改為127.0.0.1 ,那么它也不起作用

編輯:

請注意,當我嘗試設置另一個Project URL

在此處輸入圖片說明

輸入目錄:

.vs\YourApp\config\

編輯文件applicationhost.config

找到這行:

<binding protocol="http" bindingInformation="*:1399:localhost" />

替換為

<binding protocol="http" bindingInformation="*:1399:*" />

*將使其接受所有內容,因此您可以使用其他IP(例如,在android仿真器中,它可以是10.0.2.2或在瀏覽器127.0.0.1

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM