debugging Rider IDE Docker编写调试不工作

gzszwxb4  于 2023-05-18  发布在  Docker
关注(0)|答案(1)|浏览(234)

我用Rider IDE开发了一个ASP.NET多服务应用程序。
每个单独的服务都在单独的Docker容器中运行。一切都通过Docker Compose运行。
当我设置断点并通过“调试”按钮开始调试时,应用程序不会在断点处停止。
调试选项卡甚至不会变为活动状态。我尝试在Visual Studio中运行调试。它发挥了应有的作用。

  • 骑手2023.1.1
  • Docker Desktop 4.19.0
  • 选项在未启用TLS的情况下在tcp://localhost:2375上暴露守护程序
  • 选项Use Docker Compose V2 Enabled

Dockerfile

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["Services/Catalog/Catalog.API/Catalog.API.csproj", "Services/Catalog/Catalog.API/"]
RUN dotnet restore "Services/Catalog/Catalog.API/Catalog.API.csproj"
COPY . .
WORKDIR "/src/Services/Catalog/Catalog.API"
RUN dotnet build "Catalog.API.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Catalog.API.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Catalog.API.dll"]

docker-compose.yml

version: '3.4'

services:
  catalog.db:
    image: mongo
  
  catalog.api:
    image: ${DOCKER_REGISTRY-}catalog.api
    build:
      context: .
      dockerfile: Services/Catalog/Catalog.API/Dockerfile

volumes:
  mongo_data:

docker-compose.override.yml

version: '3.4'

services:
  catalog.db: 
    container_name: catalog.db
    restart: always
    ports:
      - "27017:27017"
    volumes:
      - mongo_data:/data/db
  
  catalog.api:
    container_name: catalog.api
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - "DatabaseSettings:ConnectionString=mongodb://catalog.db:27017"
    depends_on:
      - catalog.db
    ports:
      - "8000:80"

vnjpjtjt

vnjpjtjt1#

问题已在Rider版本2023.1.2中修复。

相关问题