sleemer / docker.dotnet.debug Goto Github PK
View Code? Open in Web Editor NEWThis is a sample that demonstrates how to debug dotnet core 2.0 console running in docker from vscode
This is a sample that demonstrates how to debug dotnet core 2.0 console running in docker from vscode
Running docker run is not showing anything in console. Can you update "how to run" in readme?
Hi,
An option for allowing debugging without needing to recreate the container everytime is to use a volume to share vsdbg
and the source code with the container.
Given a multistage Dockerfile, that builds your netcore image and a valid compose file that allows you to start it, you can write another compose file to debug your container:
version: '3.4'
services:
api:
image: myapi:dev
build:
target: base
labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- DOTNET_USE_POLLING_FILE_WATCHER=1
volumes:
- .:/app
- ~/.nuget/packages:/root/.nuget/packages:ro
- ~/vsdbg-core:/vsdbg:ro
entrypoint: tail -f /dev/null
Key points:
Basically this compose makes my container to be "like the basic image" (base stage), and do nothing. Source code and vsdbg is provided through bind mounts. You can start the container once and "forget about it". Then just need a "docker exec" to run vsdbg on it.
Base stage is the typical initial stage in the Dockerfile:
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
EXPOSE 80
# end of this stage
Really nice
Can you please update to vs code 1.25 seems most of it is deprecated
Hi, thanks for sharing your config, but unfortunately it isn't working properly with the latest version of VSCode.
I tried to apply to my project and it didn't work, and then I decided to use your git sample but I still getting the same error:
Starting: "docker" exec -i docker.dotnet.debug_1 /vsdbg/vsdbg --interpreter=vscode Error from pipe program 'docker': Error: No such container: docker.dotnet.debug_1
Could you highlight how can I solve this issue? have you tested with the latest version of VSCode?
Best regards,
M
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.