我收到以下错误:
"The breakpoint will not currently be hit. A copy of TokenController.cs was found in TSL.Security.Service.dll, but the current source code is different from the version built into the TSL.Security.Service.dll."

我将一步一步地了解如何构建我的.NET核心Docker映像并从这个映像运行一个容器实例,然后与VisualStudio2017远程连接,我的Dockerfile.debug就在我的问题的底部
cd ~/repos/api.security // git存储库上git pull //为.NET核心项目从git中提取最新代码dotnet restoredotnet publish //没有其他args与.pdbs一起发布docker build -t tsl.api.security.image.debug -f Docker.debug .docker run -d -p 8080:5000 -p 10222:22 --name=tsl.api.security.container.debug -t tsl.api.security.image.debug //运行并将端口5000上的容器中的.NET核心Webapi映射到主机端口8080,将容器中的ssh映射为端口22,映射到主机上的端口10222docker exec -it tsl.api.security.container.debug bash //终端从主机进入正在运行的容器/usr/sbin/sshd //启动sshd好吧,现在容器已经准备好使用Visual 2017在我的机器上使用Visual 2017进行远程调试了:



还有中提琴!我们有我的问题:

如果我们查看我的码头容器中的/app,我们可以看到pdbs:

源代码是相同的,正如我的工作流程解释中的git拉动步骤所演示的那样。
不知道从这里往哪里走..。
这是我的Dockerfile.debug:
# Use the standard Microsoft ASP.NET Core container
FROM microsoft/aspnetcore
# File Author / Maintainer
MAINTAINER Brian Ogden
WORKDIR /
RUN apt-get update && apt-get install -y unzip
RUN apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:password' | chpasswd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
#install CLRDBG, Microsoft's new cross-platform command line debugger used for debugging code running on .NET Core
RUN curl -sSL https://aka.ms/getclrdbgsh | bash /dev/stdin vs2015u2 ~/clrdbg
# Copy our code from the "/src/MyWebApi/bin/Debug/netcoreapp1.1/publish" folder to the "/app" folder in our container
WORKDIR /app
COPY ./src/TSL.Security.Service/bin/Debug/netcoreapp1.1/publish .
# Expose port 80 for the Web API traffic
ENV ASPNETCORE_URLS http://+:5000
EXPOSE 5000 22
ENTRYPOINT ["dotnet", "TSL.Security.Service.dll"]发布于 2017-06-07 00:57:23
Tools->Options->Debugging->General,关闭“要求源文件与原始版本完全匹配”。并不理想,但至少它击中了VS2017源代码中的断点集。
一旦你找到正确的解决办法,请告诉我。
https://stackoverflow.com/questions/44401483
复制相似问题