Archive | October 2017

ASP.Net core 2.0 docker container debugging

I was recently working on setting up a Docker container to run “ASP.Net core 2.0” website in debug mode. I was able to run in regular container hosting mode but after following a tutorial for ASPNet core 1.1, I tried to follow the steps and failed. Since I was new with Docker so it took a while to get it working but here is what I had to do make it work:

Original debugging tutorial suggested:

  1. Create a Docker file with this specific command for CLR debugger:
RUN apt-get update && apt-get install -y unzip

WORKDIR /clrdbg

RUN curl -SL \ \
        --output \
    && chmod 700 \
    && ./ -v latest -l . \
    && rm

2. Add following to launch.json file:

"pipeTransport": {            
                "pipeProgram": "/bin/bash",            
                "pipeCwd": "${workspaceRoot}",            
                "pipeArgs": ["-c",            
                    "docker exec -i dev_debug_1 /clrdbg/clrdbg --interpreter=mi"]

There were two issues. Apparently “clrdbg” doesn’t work with Dotnet core 2.0 (C#) anymore and other issue was that “pipeTransport” now requires debugger path attribute.


1. In your docker file, use following command for “vsdbg” (instead of clrdbg):

RUN apt-get update && apt-get install -y unzip

WORKDIR /vsdbg

RUN curl -SL | bash /dev/stdin -v latest -l /vsdbg

    2. Use following for “pipeTransport” in launch.json for (“.net launch web”)debugging support:

"pipeTransport": { 
   "pipeProgram": "docker", 
   "pipeCwd": "${workspaceRoot}", 
   "pipeArgs": ["exec -i dev_debug_1"], "debuggerPath": "/vsdbg/vsdbg", "quoteArgs": false }

Then just click the “debug run” button in Visual Studio Code, it should work if the container is already running.