本地主机拒绝连接Visual Studio中的错误 [英] localhost refused to connect Error in visual studio

查看:324
本文介绍了本地主机拒绝连接Visual Studio中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从另一个系统复制了我的解决方案文件,并试图在我的机器上运行它: 为此,我转到了项目文件夹,并删除了先前的解决方案文件,然后复制了新的解决方案文件.

I have copied my solution file from another system and tried to run it on my machine: For this, I have gone to the project folder and deleted the previous solution file and copied the new one.

现在,它开始给我错误.因此,我从这里得到了一个解决方案:

Now, it started giving me error. connection refused etc. So, I got one solution from here: How to solve ERR_CONNECTION_REFUSED when trying to connect to localhost running IISExpress - Error 502 (Cannot debug from Visual Studio)?

据此,我将端口号从1049更改为1052.它已加载,并且其中一页被加载. 但是,当我输入所需的登录凭据后,它将再次重定向到旧端口,如下所示:

According to it, I changed the port number from 1049 to 1052. It loaded and one of the pages gets loaded. But when I entered the desired login credentials then it redirected to the older port again, like this:

http://localhost:1049/Home/SearchFlight

,错误是:

 This site can’t be reached

 localhost refused to connect.
 Search Google for localhost 1049 Home Search Flight
 ERR_CONNECTION_REFUSED

现在,我不知道该怎么办.我已将端口号更改为1052,但仍指向1049.我现在该怎么办?

Now, I don't know what to do from here. I have changed the port number to 1052 but still its pointing to 1049. What should i do now?

推荐答案

我遇到了类似的问题.试试这个,它应该可以工作

I had a similar issue. Try this and it should work

  1. 转到您的项目文件夹并打开.vs文件夹(将选中的复选框保留为选中状态,因为此文件夹有时可能会被隐藏)

  1. Go to your project folder and open the .vs folder (keep your check hidden item-box checked as this folder may be hidden sometimes)

.vs文件夹中打开config文件夹

看到那个applicationhost.config文件吗?删除那个东西. (不用担心,一旦重新编译项目,它将自动重新生成.)

See that applicationhost.config file there? Delete that thing. (Do not worry it will regenerate automatically once you recompile the project.)

这篇关于本地主机拒绝连接Visual Studio中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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