New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suddenly unable to attach and debug dotnet core application in docker container #2994
Comments
Further context: I found the output from the
|
@adamkarb could you add repro steps? E.g. does the problem reproduce with vanilla web API app created with Also, what is the OS, VS Code, and Docker extension version? |
@karolz-ms System and versioning information: Docker version 20.10.7, build f0df350 VS Code version: Code 1.56.2 (Universal) (054a9295330880ed74ceaedda236253b4f39a335, 2021-05-12T17:44:30.902Z) System Info
Extensions (7)
|
@karolz-ms I just tested with a plain web application in a docker container. I got the exact same results. The |
Thanks, Adam. I can reproduce as well. |
OK I think I have figured it out. There was a relatively recent change to C# VS Code tools that changed the way process resolution works: dotnet/vscode-csharp#4509 In most cases you won't need to specify the process picker anymore; we default to looking for {
"name": "Docker .NET Core Attach",
"type": "docker",
"request": "attach",
"platform": "netCore",
"sourceFileMap": {
"/src": "${workspaceFolder}"
}
} Please let us know if this gets you unblocked |
@karolz-ms I am still suffering from this problem. The error I get now looks like
There can be multiple dotnet processes running in the same container. Just in my example, for development, my entrypoint is a
This is the return of
Why has the ability to pick a remote process been removed completely? Can't a default be supported as well as a user choice? |
BTW opening the same issue in multiple repos like this microsoft/vscode#125878 is not going to get you a faster resolution, or win you any friends, frankly |
Looks like a problem with variable substitution in launch configurations. The following configuration should work: {
"name": "Docker .NET Core Attach",
"type": "docker",
"request": "attach",
"platform": "netCore",
"processId": "${command:pickRemoteProcess}"
}, but it does not (the process picker is never shown). Investigating... |
I opened that one first, before I realized this was the proper repository for the issue. I went ahead and closed it just for you. |
Thanks! I came to believe this is a regression in C# VS Code tooling and I have opened dotnet/vscode-csharp#4607 for the C# tooling owners to take a look I also noticed the default .NET image does not contain |
@karolz-ms |
The next OmniSharp release should have the fix for this debugging scenario--I do not think there is anything on the Docker extension side to change. Resolving as "external" for now, but please reopen/create new issue as necessary if something still does not work. |
I have an existing launch configuration that I have been using to successfully debug a dotnet core application within a Docker container. The configuration I use in
launch.json
is as follows:What is happening as of late suddenly, is that when launching the debug process, the following occurs:
No process with the specified id is currently running.
Before I began experiencing this bug/error, the
"${command:pickRemoteProcess}"
would provide me a dropdown of all processes running within the container I chose in step 1, but now it is not doing this, but immediately erroring.What works:
If I start my dotnet core application in the container, enter the container and find the process ID within, and input it into the
processId
field of my launch configuration, it will successfully attach.Are my configurations incorrect suddenly? Is there a better way to configure this setup?
The text was updated successfully, but these errors were encountered: