-
Notifications
You must be signed in to change notification settings - Fork 522
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
Can't launch coreclr docker debugger #742
Comments
@mbialecka Can you provide a little more context (e.g. where is the project file in this scenario, where is the Dockerfile relative to the project file and/or the workspace folder, etc.)? Can you debug a "basic" .NET Core project (e.g. |
This is the folder structure:
When I created an empty web app with a custom Dockerfile, it worked. When I added a subdirectory with a console project and changed Dockerfile and launch configurations to use it, I get a similar error:
Simple repro setup:
Dockerfile.sub.debug:
launch.json:
|
Can you try the following: {
"name": "Docker: Launch SUB",
"type": "docker-coreclr",
"request": "launch",
"preLaunchTask": "build",
"appFolder": "${workspaceFolder}/subdir",
"dockerBuild": {
"dockerfile": "${workspaceFolder}/Dockerfile.sub.debug"
},
"dockerRun": {}
} or {
"name": "Docker: Launch SUB",
"type": "docker-coreclr",
"request": "launch",
"preLaunchTask": "build",
"appProject": "${workspaceFolder}/subdir/subdir.csproj",
"dockerBuild": {
"dockerfile": "${workspaceFolder}/Dockerfile.sub.debug"
},
"dockerRun": {}
} The debugging logic expects the In any case, I agree that the error returned is not intuitive; I'll add an item to the list to better detect/report incorrect options. |
Thanks @philliphoff for pointing this out. I had a problem with not specifying the csproj filename. I got confused by the help article https://github.com/Microsoft/vscode-docker#application-customizations. Somehow I thought that it will find the csproj in the folder I specified. Now it seems obvious that I should have used appFolder if I wanted to specify folder path only. Although I no longer get the error that started the thread, I still don't have the debugger up and running... I see this output in VS Code Debug Console:
I don't understand where it's coming from. My custom Dockerfile builds and publishes the binaries, and when I manually build the image, it has all the dependencies in the app folder and starts up fine. Also I'm pretty sure I use only netcoreapp2.1, not netstandard2.0. I have an attach configuration that works fine with container built from the Dockerfile I'm trying to use for the launch configuration. |
@mbialecka Hmmm, my first suspicion would be that the dependencies didn't make it into the container. Debugging (launch) .NET Core in Docker in VS works a little differently than the attach scenario; we only build the We can try to sort it out via Teams/LiveShare, too, if you like. |
Leaving myself a note: it may be useful to add a switch to optionally disable auto-killing of containers after debugging. If the debugging dies prematurely, then we can't go spelunking into the container as it's already been cleaned up. |
For posteriority: I had to add the following to my csproj:
Now it works. Can be closed. |
@mbialecka Great! Thanks! |
From @mbialecka on January 15, 2019 3:23
Environment data
dotnet --info
output:.NET Core SDK (reflecting any global.json):
Version: 2.1.403
Commit: 04e15494b6
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18305
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.403\
Host (useful for support):
Version: 2.1.5
Commit: 290303f510
.NET Core SDKs installed:
2.1.4 [C:\Program Files\dotnet\sdk]
2.1.104 [C:\Program Files\dotnet\sdk]
2.1.201 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.400 [C:\Program Files\dotnet\sdk]
2.1.401 [C:\Program Files\dotnet\sdk]
2.1.403 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.3-servicing-26724-03 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
VS Code version:
Version: 1.30.2 (user setup)
Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
Date: 2019-01-07T22:53:57.820Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT ia32 10.0.18305
C# Extension version: 1.17.1
Steps to reproduce
I'm trying to launch debugger for a dockerized app. I'm using modified configuration "Docker: Launch .NET Core (Preview)" with custom Dockerfile, project location, and env vars:
Actual behavior
I get the following error:
Action: debugCoreClr
Error type: ENOENT
Error Message: ENOENT: no such file or directory, unlink 'C:\Users\username\AppData\Local\Temp\temp_1547521110923_29680_8.tmp'
Version: 0.5.1
OS: win32
Copied from original issue: dotnet/vscode-csharp#2792
The text was updated successfully, but these errors were encountered: