为什么我无法向本地主机上的 ASP.NET 开发服务器发出 http 请求?
我有一个 ASP.NET 项目(Windows 7 上的 VS2008,带有 Webforms、MVC1 或 MVC2——对我来说都是相同的结果),它只是 File->New hello world Web 项目。它使用默认的 ASP.NET 开发服务器,当我使用 F5 启动服务器时,浏览器永远不会连接,并且出现超时。我尝试在开发服务器运行时通过远程登录到开发服务器的端口来调试它,得到了相同的结果:
C:\Users\farmercs>telnet localhost 54752
Connecting To localhost...Could not open connection to the host, on port 54752:
Connect failed
我可以在系统托盘中看到服务器认为它正在运行,并且出现 netstat -a -n 命令显示该端口上确实有一个活动的 TCP 侦听器。
这在不久的过去就行得通,我可以使用开发服务器来处理 Web 项目。从那时起发生的一件事是 我安装了 Microsoft Loopback Adapter 以适应本地开发 Oracle 安装。我不确定这就是问题所在,但它似乎可能是罪魁祸首。
我还尝试使用服务器名称本身(http://mycomputername:54752
)来访问端口,但结果相同。
那么,是什么阻碍了我的连接呢?如果是环回,那么有什么好方法可以让我保留连接到开发 Oracle 服务器的能力,同时仍然能够使用 ASP.NET 开发服务器?
I have an ASP.NET project (VS2008 on Windows 7 with either webforms, MVC1, or MVC2 -- all the same result for me) which is just the File->New hello world web project. It's using the default ASP.NET development server, and when I start the server with F5, the browser never connects and I get a timeout. I tried to debug this by telnetting to the development server's port while it was running, and I got the same result:
C:\Users\farmercs>telnet localhost 54752
Connecting To localhost...Could not open connection to the host, on port 54752:
Connect failed
I can see in the system tray that the server thinks it's running, and a netstat -a -n
command shows that there is indeed an active TCP listener on that port.
This worked in the not-too-distant past, and I could work on web projects using the development server. One thing that has changed since then was that I installed the Microsoft Loopback Adapter to accommodate a local development Oracle installation. I'm not sure this is the problem, but it seems a likely culprit.
I also tried to hit the port using the server name itself (http://mycomputername:54752
) but with the same result.
So, what could be blocking me from connecting? And if it's the loopback, then what is a good way for me to retain my ability to connect to my development Oracle server while still being able to use the ASP.NET development server?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你检查过你的主机文件吗?
%SystemRoot%\windows\system32\drivers\etc\host
看看是否有 localhost 或 127.0.0.1 重定向到其他地方而不是你的电脑
have you checked your host file?
%SystemRoot%\windows\system32\drivers\etc\host
look if there is any redirection of localhost or 127.0.0.1 to somewhere else rather than your pc