Debugging with Docker in Visual Studio 2022 fails when editing Dockerfile


I set up a project that allows debugging in a Linux docker container in Visual Studio 2022. Now, I wanted to add a stage prior to the build stage. For the sake of simplicity I just show a simplified version using some dummy alpine stage.

Extract from Dockerfile

This gives me the following error when trying to debug:

Debugging Error

Docker command failed with exit code 127. docker: Error response from
daemon: failed to create task for container: failed to create shim
task: OCI runtime create failed: runc create failed: unable to start
container process: exec “dotnet”: executable file not found in $PATH:
unknown. If the error persists, try restarting Docker Desktop.

Error message

Note: This works if I switch to ‘Release’ – but I want to make use of the debugging facilities.

What can I do?

Leave a Reply

Your email address will not be published. Required fields are marked *