I was successfully able to dockerize my webapplication. Unfortunately Debugging only works partially within the docker container. All the code that is located in the startup project is debuggable, but the assemblies that are being loaded at runtime don't work.
I am aware that .pdb
files need to be loaded for debugging to work. I was able to check the loaded symbols in the output and to no surprise when I am starting it with windows the symbols can be loaded, but when I start through my docker compose only the symbols from my startup project and the projects directly referenced can be loaded.
The location of dll
and pdb
- Plugins/bin/<PluginName>.dll
- Plugins/<PluginName>/<PluginName>.pdb
Any Idea what could be causing this behaviour?
#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:2.2-stretch-slim AS base
WORKDIR /app
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build
WORKDIR /src
COPY ["Presentation/Nop.Web/Nop.Web.csproj", "Presentation/Nop.Web/"]
COPY ["Libraries/Nop.Services/Nop.Services.csproj", "Libraries/Nop.Services/"]
COPY ["Libraries/Nop.Core/Nop.Core.csproj", "Libraries/Nop.Core/"]
COPY ["Libraries/Nop.Data/Nop.Data.csproj", "Libraries/Nop.Data/"]
COPY ["Presentation/Nop.Web.Framework/Nop.Web.Framework.csproj", "Presentation/Nop.Web.Framework/"]
RUN dotnet restore "Presentation/Nop.Web/Nop.Web.csproj"
COPY . .
WORKDIR "/src/Presentation/Nop.Web"
RUN dotnet build "Nop.Web.csproj" -c Debug -o /app/build
FROM build AS publish
RUN dotnet publish "Nop.Web.csproj" -c Debug -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Nop.Web.dll"]
Note the my plugin is built outside the docker container with visual studio. and the output is located inside the project Nop.Web