无法连接到网络服务器 [英] Unable to connect to web server

查看:58
本文介绍了无法连接到网络服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题之前已经在这里讨论过很多次了,但相信我,我已经尝试了其中的每一个,但仍然有这个问题.

I know that this problem has been discussed here a lot of times before but believe me I've tried every single one of them and I still have this issue.

作为在拉我头发之前的最后手段,我决定再次提出这个问题并解释我到目前为止所做的尝试:

As a last resort before pulling my hair I decided to ask the question again and explain what I have tried so far:

  1. 我尝试的第一件事是从项目中删除 .vs 文件夹,因为我在这里某处读到了它.
  2. 我删除了以管理员身份启动 Visual Studio 的 .vs 文件夹并更改了端口号.
  3. 我从 [Documents]/IISExpress 中删除了 IISExpress 文件夹
  4. 此时我非常生气,所以我卸载并重新安装了 Visual Studio 2017 Enterprise.
  5. 我卸载并重新安装了 IISExpress 10
  6. 我卸载了 IISExpress 10 并安装了 IISExpress 8
  7. 我将 127.0.0.1 localhost 放到我的主机文件中(以前没有)

这里没有任何东西能解决我的问题,所以在这一点上我非常绝望并且愿意接受任何类型的建议.

Nothing here did solved my problem so at this point I am pretty desperate and open to any kind of suggestions.

我将 Windows 10 与 Visual Studio 2017 一起使用,无法运行任何项目,无论是调试模式还是非调试模式.我一直遇到同样的错误 - 无法连接到网络服务器.

I am using Windows 10 with Visual Studio 2017 and cannot run any of the projects neither debug nor without debug mode. I am getting the same error all the time - Unable to connect to web server.

感谢任何帮助.提前致谢.

Any help is appreciated. Thank you in advance.

推荐答案

  1. 清理并重建项目依赖项
  2. 清理并重建主要项目
  3. 验证launchsettings 和项目构建属性
  4. 关闭VS
  5. 从项目中清除binobj 文件夹
  6. 转到 C:\Users\username\Documents\IISExpress\config 并删除此文件夹中的所有文件
  7. 从解决方案目录中删除 .VS 文件夹
  8. 验证 launchsettings.json 具有正确的格式/语法.您必须将此 applicationUrl 列在正确的位置,如下所示:
  1. Clean and Rebuild Projects dependencies
  2. Clean and Rebuild the primary project
  3. Verify launchsettings and project build properties
  4. Close VS
  5. Clear bin and obj folders from project
  6. Go to C:\Users\username\Documents\IISExpress\config and delete all files from this folder
  7. Remove the .VS folder from the solution directory
  8. Verify the launchsettings.json has the correct format/syntax. You must have this applicationUrl listed in correct location like below:

您也可以使用 netstat 查看所有正在使用的端口;请注意,您必须查看您使用的所有 IIS Express 端口以及所有本地 IIS 端口.

Also you can use netstat to see all the ports in use; be aware that you must look at all IIS Express ports you use, and all local IIS ports.

了解 IIS 将侦听一个端口,并反向代理到 Kestrel 服务器正在侦听的另一个端口.

Understanding that IIS will listen on one port, and reverse proxy to another port where the Kestrel server is listening.

{
  "IIS Express": {
    "commandName": "IISExpress",
    "launchBrowser": true,
    "launchUrl": "api/values",
    "environmentVariables": {
      "ASPNETCORE_ENVIRONMENT": "Development"
    },
    "applicationUrl": "http://localhost:44316/"
  }
}

  1. 重新启动 Visual Studio,确保您以管理员身份运行
  2. 清理并重建项目依赖项
  3. 清理并重建主要项目

这篇关于无法连接到网络服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆