简体   繁体   English

在visual studio中运行Web应用程序无法访问本地主机此站点

[英]localhost this site can't be reached running web application in visual studio

I open my solution in VS2019, select the web application and press F5 to run in the debugger The browser is set to IIS Express (Google Chrome) localhost:51872 opens in Chrome with a message我在 VS2019 中打开我的解决方案,选择 web 应用程序并按 F5 在调试器中运行浏览器设置为 IIS Express (Google Chrome) localhost:51872 在 Chrome 中打开并显示一条消息

This site can't be reached. 
The connection was reset 
ERR_CONNECTION_RESET

In developer tools Network tab, I see an entry for localhost with status failed在开发人员工具网络选项卡中,我看到一个 localhost 的条目,状态为 failed

状态失败

If I click the entry I can see under the Timing tab that it is Stalled and the Explanation button takes me to this help about queueing如果我单击条目,我可以在“计时”选项卡下看到它已停止,“说明”按钮将我带到有关排队的帮助

Queueing.排队。 The browser queues requests when: There are higher priority requests.浏览器在以下情况下对请求进行排队: 有更高优先级的请求。 There are already six TCP connections open for this origin, which is the limit.已经为此源打开了六个 TCP 连接,这是限制。 Applies to HTTP/1.0 and HTTP/1.1 only.仅适用于 HTTP/1.0 和 HTTP/1.1。 The browser is briefly allocating space in the disk cache浏览器在磁盘缓存中短暂分配空间

What should I try to fix this?我应该尝试什么来解决这个问题?

I have tried two computers, both with Win 10 1903 one with build 18362-10005 and one with build 17763.615我试过两台电脑,一台是 Win 10 1903,一台是 build 18362-10005,另一台是 build 17763.615

I have tried uninstalling and reinstalling chrome uninstalling and reinstalling internet explorer我尝试卸载并重新安装 Chrome 卸载并重新安装 Internet Explorer

There are several projects in the solution including a web application that does work.解决方案中有几个项目,包括一个有效的 Web 应用程序。

The web app that does work has startup.cs, Program.cs and appsettings.json.可以工作的 Web 应用程序有 startup.cs、Program.cs 和 appsettings.json。

The one that does not work has none of these.不起作用的那个没有这些。 It does have Default.aspx and Web.config.它确实有 Default.aspx 和 Web.config。 Perhaps I am missing some fundemental understanding.也许我缺少一些基本的理解。

当我将 index.html 添加到应用程序时,我可以毫无错误地运行该项目。

put this line in hosts file将此行放在主机文件中

127.0.0.1 www.yourdomain.com 127.0.0.1 www.yourdomain.com

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM