无法连接到内置 Web 服务器的 Web 开发人员

发布于 2024-07-16 12:55:20 字数 245 浏览 6 评论 0原文

当我昨天返回 Visual Web Developer 时,我无法再运行/调试我的项目。 单击绿色播放按钮将启动 ASP.NET 开发服务器(并显示在系统托盘中),但浏览器仅显示错误消息“Firefox 无法连接到 localhost:58127”(翻译自瑞典语)。 IE7 提示“无法显示网页”。

我不明白为什么会发生这种情况。 几周前它起作用了。 是否有某个 Windows 设置将事情搞砸了? (我尝试禁用防火墙而不做任何更改。)

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".

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.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

始终不够爱げ你 2024-07-23 12:55:21

您是否正在使用 NOD32 或任何其他防病毒软件这可能会引起问题?

Are you perhaps using NOD32 or any other antivirus that may cause problems?

◇流星雨 2024-07-23 12:55:21

我今天遇到了这个问题,只是想详细说明一下,因为我的主机文件已经定义了“127.0.0.1 localhost”。

我能够通过引用 localhost 查看默认的 IIS 站点,但是当我尝试在 IDE 中进行调试时,它总是在 IE 中显示“无法显示网页”,在 Chrome 中显示“哎呀!Google Chrome 无法连接到本地主机”。

我打开命令提示符并输入“netstat -a”并查看结果。 我看到我的调试 Web 服务器使用的端口仅在 [::1] 的本地地址上被列为“侦听”:

TCP [::1]:64212 [ComputerName]:0 LISTENING

对我来说不寻常的是调试工作了一段时间,然后好像突然停止了。 前几次发生这种情况时,我重新安装了 Visual Web Developer Express 2010。这变得相当烦人,因为这是一个漫长的过程,并且在似乎任意一段时间后问题仍然重新出现。

最近一次,我更改了主机文件以包含“::1 localhost”(与此解决方案和我在网上找到的许多其他解决方案相反),这解决了我的调试环境问题。

我很感激这解决了我的问题,但我仍然好奇我的调试环境为何以及如何改变。 另外,我很好奇为什么除了 127.0.0.1 之外还有多个环回地址。 “::1”是 ip6 标准吗? 如果是这样,那么 localhost 不应该路由到 127.0.0.1 并由 tcp/ip 堆栈解释为与 ::1 相同吗?

I encountered this issue today and just wanted to elaborate because my hosts file had "127.0.0.1 localhost" already defined.

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.

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:

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.

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.

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?

遗失的美好 2024-07-23 12:55:21

我在使用 Visual Studio 2013 时遇到了这个问题。 我已手动设置防火墙系统。 这意味着,在程序通信时防火墙会通知我。 错误链接到“devenv.exe”已被防火墙阻止。 正确的通信模式“devenv.exe”将解决问题。 根据您的情况,检查防火墙选项和过滤的通信。

I had this problem with Visual Studio 2013. I have set the Firewall system manually. This means that, at the time of communication by programs Firewall notify me. Incorrectly linked to "devenv.exe" was blocked by the Firewall. Correct mode of communication "devenv.exe" will solve the problem. in your case cheeck Firewall options and filtered communications.

陈年往事 2024-07-23 12:55:20

你用的是Vista吗? 我最近的 Vista 更新也遇到了同样的问题。

首先,确保 Visual Studio 正在“以管理员身份”运行。

其次,当浏览器启动时,将“http://localhost:”替换为“http://127.0.0.1:"。 如果有效,则说明 Windows 更新弄乱了您的主机文件。

如果是这种情况,请确保您的主机文件中包含此行,未注释:“127.0.0.1 localhost”

我的主机文件位于此目录中:“C:\Windows\System32\drivers\etc”

您的主机文件将类似对此。

Are you using Vista? I've had the same issues with recent Vista updates.

Firstly, make sure Visual Studio is running "As Administrator".

Secondly, when the browser launches, replace "http://localhost:" with "http://127.0.0.1:". If that works, then its because a Windows Update messed up your hosts file.

If this is the case, make sure you hosts file has this line in it, uncommented: "127.0.0.1 localhost"

my hosts file is in this directory: "C:\Windows\System32\drivers\etc"

yours will be something similar to that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文