如何解决骑手docker调试问题

时间:2020-03-27 12:38:38

标签: docker debugging .net-core rider

所以我有一个在Visual Studio上开发的.net core 3.1 Web api项目。我现在已切换到rider,尝试调试应用程序时出现错误。我可以运行它构建的应用程序,并在本地Docker容器中正常运行。

当我按下调试按钮时,出现以下错误:

Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'JetBrains.Platform.Core, Version=777.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325' or one of its dependencies.
File name: 'JetBrains.Platform.Core, Version=777.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'JetBrains.Platform.Core, Version=777.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325' or one of its dependencies.
File name: 'JetBrains.Platform.Core, Version=777.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325'

什么原因导致此错误,我该如何解决?

其他信息:

Dockerfile:

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["Niverobot.WebApi/Niverobot.WebApi.csproj", "Niverobot.WebApi/"]
COPY ["Niverobot.Domain/Niverobot.Domain.csproj", "Niverobot.Domain/"]
RUN dotnet restore "Niverobot.WebApi/Niverobot.WebApi.csproj"
COPY . .
WORKDIR "/src/Niverobot.WebApi"
RUN dotnet build "Niverobot.WebApi.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Niverobot.WebApi.csproj" -c Release -o /app/publish

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

在骑手中运行配置:Rider run config

2 个答案:

答案 0 :(得分:0)

我在rider的文档中读到它还不支持Windows上的docker调试。

答案 1 :(得分:0)

您好,您问我上个月是否可以共享我的运行/调试配置。我今天才看到消息。在这里。

enter image description here

除了遵守文档以使其正常工作外,我别无选择。我最近将Rider升级到2020.1,发现这对我在Rider中运行.NetCore 3.1的某些问题有所帮助。

我看到的设置和您的设置之间唯一的区别是我使用的是docker-compose