作者:墨镜小靖 | 来源:互联网 | 2023-05-19 05:09
WhenIyesterdayreturnedtoVisualWebDeveloperIwasnolongerabletorundebugmyprojects.Cli
When I yesterday returned to Visual Web Developer I was no longer able to run/debug my projects. Clicking the green play button launches ASP.NET Development Server (and it shows up in the systray) but the browser only shows the error message "Firefox is not able to connect to localhost:58127" (translated from Swedish). IE7 says "Cannot show web page".
当我昨天回到Visual Web Developer时,我无法再运行/调试我的项目。单击绿色播放按钮启动ASP.NET Development Server(它显示在系统托盘中),但浏览器仅显示错误消息“Firefox无法连接到localhost:58127”(翻译自瑞典语)。 IE7说“无法显示网页”。
I cannot figure out why this happens. It worked a couple of weeks back. Could there be a Windows setting that mess things up? (I've tried to disable the firewall without any change.)
我无法弄清楚为什么会这样。它工作了几个星期。可能有一个Windows设置弄乱了吗? (我试图在没有任何改变的情况下禁用防火墙。)
4 个解决方案
I encountered this issue today and just wanted to elaborate because my hosts file had "127.0.0.1 localhost" already defined.
我今天遇到了这个问题,只是想详细说明,因为我的hosts文件已经定义了“127.0.0.1 localhost”。
I was able to see the default IIS site by referencing localhost but when I tried debugging in my IDE it would always display "cannot display webpage" in IE and "Oops! Google Chrome cannot connect to localhost" in Chrome.
我通过引用localhost看到了默认的IIS站点,但是当我在IDE中尝试调试时,它总是会在IE中显示“无法显示网页”,并且Chrome中的“糟糕!谷歌浏览器无法连接到本地主机”。
I opened a command prompt and typed "netstat -a" and reviewed the results. I saw that my port used by my debugging web server was listed as "LISTENING" on the local address of [::1] only:
我打开一个命令提示符并输入“netstat -a”并查看结果。我看到我的调试Web服务器使用的端口仅在[:: 1]的本地地址上列为“LISTENING”:
TCP [::1]:64212 [ComputerName]:0 LISTENING
TCP [:: 1]:64212 [ComputerName]:0 LISTENING
What's unusual to me is that debugging worked for a period of time and then it seemed like all of a sudden it stopped. The first couple times it happened I re-installed Visual Web Developer Express 2010. This became rather annoying because it was a long process and the problem continued to resurface after what seemed to be an arbitrary period of time.
对我来说不同寻常的是,调试工作了一段时间,然后似乎突然停止了。它发生的前几次我重新安装了Visual Web Developer Express 2010.这变得相当烦人,因为这是一个漫长的过程,并且问题在看起来是一段任意的时间后继续重现。
This latest time I changed my hosts file to include "::1 localhost" (the opposite of this solution and numerous others I found online) and that has resolved my issues with my debugging environment.
这个最新的时间我改变了我的hosts文件,包括“:: 1 localhost”(这个解决方案和我在网上发现的其他许多其他对象),这解决了我的调试环境问题。
I'm grateful this resolved my issue but am still curious as to why and how my debugging environment seems to change. Additionally, I'm curious why there are multiple loopback addresses other than 127.0.0.1. Is "::1" an ip6 standard? If so, shouldn't localhost be routing to 127.0.0.1 and interpreted by the tcp/ip stack as the same as ::1?
我很感激这解决了我的问题,但我仍然很好奇我的调试环境为何以及如何改变。另外,我很好奇为什么除了127.0.0.1之外还有多个环回地址。 “:: 1”是ip6标准吗?如果是这样,localhost是否应该路由到127.0.0.1并由tcp / ip堆栈解释为与:: 1相同?