[英]Docker-Compose Connection Refused with ASP-NET Core 5
I've been using ASP.NET Core 5.0 for a project and running it via docker-compose inside VS2017 Community.我一直在为一个项目使用 ASP.NET Core 5.0 并通过 VS2017 社区内的 docker-compose 运行它。 Previously when I ran the project it would connect to a port automatically published by Visual Studio and load the web application (see image 1).
以前,当我运行项目时,它会连接到 Visual Studio 自动发布的端口并加载 web 应用程序(见图 1)。 However, similarly to another project, it simply refuses connection when debugging starts (see image 2).
然而,与另一个项目类似,它只是在调试开始时拒绝连接(见图 2)。
Even when manually publishing the ports via the ports:
portion of the docker-compose.yml
file it still refuses connection.即使通过端口手动发布
ports:
docker-compose.yml
文件的一部分,它仍然拒绝连接。
After trying to find a solution to no avail, I've turned to asking here.在试图找到解决方案无济于事后,我转向这里询问。 I've tried all of the following:
我已经尝试了以下所有方法:
.vs
folder and restarting..vs
文件夹并重新启动。80
and 443
explicitly in docker-compose.yml
docker-compose.yml
中显式暴露端口80
和443
As mentioned before this behavior has also started occurring on a university assignment which is running ASP.NET Core 3.1, which I prefer to have working before it's due.如前所述,这种行为也开始发生在运行 ASP.NET Core 3.1 的大学作业中,我更喜欢在到期之前工作。
I did Clean/Purge Data
on Docker Desktop for Windows, restarted and it seems to be working now.我在 Windows 的 Docker 桌面上进行了
Clean/Purge Data
,重新启动它现在似乎可以工作了。 I really wish I knew what actually causes this problem so I can avoid in in the future....我真的希望我知道究竟是什么导致了这个问题,这样我以后就可以避免......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.