简体   繁体   English

Docker-Compose 连接被 ASP-NET Core 5 拒绝

[英]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:我已经尝试了以下所有方法:

  • Restarting Visual Studio重新启动 Visual Studio
  • Deleting the .vs folder and restarting.删除.vs文件夹并重新启动。
  • Restarting computer.重新启动计算机。
  • Exposing ports 80 and 443 explicitly in docker-compose.ymldocker-compose.yml中显式暴露端口80443
  • Checking out to previous, known working commits.签出以前的已知工作提交。

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.

相关问题 我的docker-compose asp.net核心项目未正确运行,我得到ERR_CONNECTION_REFUSED - My docker-compose asp.net core project is not properly running, I get ERR_CONNECTION_REFUSED Docker 设置中的 .Net Core 3.1 MSSQL 后端:Docker-compose up 产生连接失败 - .Net Core 3.1 MSSQL backend in Docker setup: Docker-compose up producing connection failure 使用 docker-compose 将带有 MySQL 持久化数据库的 ASP.NET Core Web 应用 Docker 化为两个单独的容器 - Dockerize an ASP.NET Core Web App with MySQL persisting Database as two separate containers with docker-compose Docker-Compose YML 与 ASP.NET Core 2.2 Web API 和 SQL Server 2017 - Docker-Compose YML with ASP.NET Core 2.2 Web API and SQL Server 2017 如何解决 docker-compose 环境变量不起作用 ASP.Net Core MVC - How to solve docker-compose environment variables not working ASP.Net Core MVC System.ArgumentNullException:值不能为 null。(参数“connectionString”)asp.net 核心 Docker-compose - System.ArgumentNullException: Value cannot be null. (Parameter 'connectionString') asp.net Core Docker-compose ASP-Net Core Sql命令并发问题 - ASP-Net Core Sql command concurrency issue .net核心应用程序无法连接到RabbitMQ(两者都通过docker-compose在docker网络中运行) - .net core app ca't connect to rabbitMQ (both running in a docker network via docker-compose) Plesk Linux ASP.NET Core ERR_CONNECTION_REFUSED - Plesk Linux ASP.NET Core ERR_CONNECTION_REFUSED 如何在 docker-compose 命令中将 appsettings.json 值替换为 .env 变量以启动 ASP.NET 核心 MVC 应用程序? - How do I replace appsettings.json values with .env variable in docker-compose command to launch an ASP.NET Core MVC app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM