简体   繁体   English

从 Visual Studio 在本地主机上运行 .NET API 时获取 ERR_CONNECTION_REFUSED

[英]Getting ERR_CONNECTION_REFUSED when running .NET API on localhost from Visual Studio

I'm a newbie in .NET coding, I'm trying to run a project using .NET using IIS Express on Google chrome, I get this error: ERR_CONNECTION_REFUSED我是 .NET 编码的新手,我正在尝试使用 .NET 在 Google chrome 上使用 IIS Express 运行一个项目,我收到此错误:ERR_CONNECTION_REFUSED

在此处输入图像描述

Here is what I've tried so far, and it does not work:这是我到目前为止尝试过的,但它不起作用:

  • Changing the port number under properties section, and creating a new virtual directory更改属性部分下的端口号,并创建一个新的虚拟目录在此处输入图像描述

  • Removing the applicationhost.config from the.vs project folder从 .vs 项目文件夹中删除 applicationhost.config

  • Disabling the proxy禁用代理

  • Running Visual Studio as an Administrator以管理员身份运行 Visual Studio

  • Disabling the Script Debugging禁用脚本调试

While creating the database connection try to use port number with localhost it worked for me so might go same with you as well.... Good luck.在创建数据库连接时,尝试将端口号与 localhost 一起使用,它对我有用,所以 go 也可能与你一样......祝你好运。

Please try to visit your HTTPS address, some websites may disable HTTP connection, such as Asp.Net Core Application.请尝试访问您的 HTTPS 地址,某些网站可能会禁用 HTTP 连接,例如 Asp.Net Core Application。
在此处输入图像描述
Besides, try to repair the IIS Express in the console panel.此外,尝试在控制台面板中修复 IIS Express。
在此处输入图像描述
Feel free to let me know if the problem still exists.如果问题仍然存在,请随时告诉我。

In my case, this issue was resolved by removing the .vs file followed by restarting Visual Studio as an Administrator就我而言,此问题已通过删除.vs文件并以管理员身份重新启动 Visual Studio 来解决

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

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