在 IISExpress 上启动本地主机:远程设备或资源不会接受连接

Launching localhost on IISExpress: The remote device or resource won't accept the connection

我在 Visual Studio 2015 年尝试使用 IISExpress 启动我的 Web 项目。我有一个 RESTful 服务项目和一个前端网站。两者都不会启动,在深入研究 Internet Explorer 中的诊断后,我发现了错误消息

The remote device or resource won't accept the connection.

我已尝试重置 Internet Explorer,但没有可能干扰连接的代理服务器。

A) 检查以确保 IISExpress 是 运行ning。首先,在 Visual Studio 中启动您的项目,然后单击开始按钮并搜索 'Resource Monitor'。展开 'Network' 部分并查找 IISExpress。您也可以使用 Ctrl-Alt-Delete 并选择任务管理器来查看 IISExpress 是否正在 运行ning。如果它不存在,则 IISExpress 有问题,甚至 运行ning 都没有。在这种情况下,您可以通过在 IIS 中将 Web 项目配置为 运行 来解决此问题。

  1. 确保在计算机上设置了 IIS
    How to enable IIS on Windows
  2. 配置 Visual Studio 以使用 IIS 到 运行 网络项目
    Use Local IIS as a Web Server in Visual Studio

B) 检查 IISExpress 与 Visual Studio 的版本兼容性。例如,IISExpress 10 不适用于 VS 2017。

C) IISExpress 之夜没有开始的原因有很多

IISExpress Troubleshooting on Whosebug