Reputation: 595
VS2019 Professional is missing the "Start Debugging" action item which is preventing me from debugging within my docker container.
I have created a launchSettings.json
file to explicitly set the StartDebugging
action, but still it is omitted from the profile and the debugger does not get attached when attempting to run in debug mode.
{
"profiles": {
"Docker Compose": {
"commandName": "DockerCompose",
"serviceActions": {
"data": "StartDebugging",
"api": "StartDebugging",
"graphql": "StartDebugging",
"kafka": "StartWithoutDebugging"
},
"commandVersion": "1.0"
}
}
}
Another member on the team has the same IDE version as I do, but has no issues having the debugger attached when running in debug mode. We have compared our VS2019 installations and confirmed that we have same workloads installed as well, yet his has the option.
Why would the "Start Debugging" action be missing and how do I bring it back?
Upvotes: 4
Views: 1239
Reputation: 8431
I fixed this by recreating a new solution and, when creating a new project, to make sure it is not checked (false) when it asks: "Place solution and project in the same directory"
In short, do NOT place the project and solution in the same directory if you are going to use docker-compose with VS solution.
All .net services referenced in the docker-compose file of the solution apparently need to be projects that are located in a subdirectory of the solution directory.
Upvotes: 0
Reputation: 126
I was having the same problem and saw this thread: docker compose doesn't work debugging. The workaround worked for me: disable Docker-Compose V2 support by running docker-compose disable-v2
and then restart Docker Desktop. This is apparently caused by the recent change in docker compose v2 behavior; see Output of "docker compose config" does not contain full path to context
Upvotes: 3