I'm building a Linux application and debugging it by publishing self-contained executable to the remote target host and attaching Visual Studio debugger.
When I publish it as a single file with this command
dotnet publish --configuration Debug --runtime linux-x64 --output ./publish --self-contained -p:PublishSingleFile=true
the debugger fails to connect:
One or more errors occurred.
Failed to attach to process: Failed to load the .NET Debugging Services.
The application can be debugged when it's not self-contained. Is single file debugging possible at all?
I'm building a Linux application and debugging it by publishing self-contained executable to the remote target host and attaching Visual Studio debugger.
When I publish it as a single file with this command
dotnet publish --configuration Debug --runtime linux-x64 --output ./publish --self-contained -p:PublishSingleFile=true
the debugger fails to connect:
One or more errors occurred.
Failed to attach to process: Failed to load the .NET Debugging Services.
The application can be debugged when it's not self-contained. Is single file debugging possible at all?
Share edited Mar 18 at 11:06 jackhab asked Mar 4 at 8:42 jackhabjackhab 17.8k39 gold badges108 silver badges143 bronze badges 9- Are you attaching to a process on a remote computer(Linux)? – Dou Xu-MSFT Commented Mar 5 at 8:18
- @DouXu-MSFT Yes – jackhab Commented Mar 5 at 14:53
- @jackhab not with managed code debugger. You can change the code type to be Native but not sure how good the experience would be – Paweł Łukasik Commented Mar 5 at 17:06
- 1 Yes, I'm connecting via SSH and I'm copying all the content of publish folder. Attaching debugger only fails when I publish as single file. – jackhab Commented Mar 15 at 12:02
- 1 @BDisp Thanks! Do you mind posting it as an answer so that I can tick it as accepted? – jackhab Commented Mar 23 at 20:12
1 Answer
Reset to default 0No, debugging single file is not supported. See https://github/dotnet/vscode-csharp/wiki/Troubleshoot-loading-the-.NET-Debug-Services.