.NET 5 linux-arm: Unable to attach to CoreCLR. Unknown Error: 0x80131c4f
See original GitHub issueIssue Description
I’m trying to build a simple console project in VS Code on Win 10 x64 using the .NET 5 (5.0.100) SDK. When deploying and executing the program remotely on a Raspberry Pi 4 using the ‘vsdbg’-Debugger the debugger fails with the following error: Unable to attach to CoreCLR. Unknown Error: 0x80131c4f
.
Steps to Reproduce
- I have created a minimal console project with the following content:
RPiDemo.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>
Program.cs
using System;
namespace RPiDemo
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello RPi!");
}
}
}
The project is successfully compiled in VS Code on Win 10 x64 using the locally installed .NET 5 SDK. The project is published for ‘linux-arm’ and copied to the Raspberry Pi 4 (with Raspian 10, latest version as of today) with the following command:
dotnet publish -c Release -r linux-arm -o ./publish/linux-arm ${workspaceFolder} ; scp -rp -P 2222 ./publish/linux-arm/ root@192.168.81.129:/opt/RPiDemo
I’m essentially following the instructions at https://github.com/OmniSharp/omnisharp-vscode/wiki/Remote-Debugging-On-Linux-Arm (or similar tutorials on the internet).
The project is then launched on the RPi with the ‘vsdbg’ remote debugger. My launch.json looks like this:
{
"configurations": [
{
"name": "Launch LOCAL",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/net5.0/RPiDemo.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"console": "internalConsole"
},
{
"name": "Launch REMOTE",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "BuildPublishCopyLinuxARM",
"program": "/usr/bin/dotnet",
"args": [
"/opt/RPiDemo/RPiDemo.dll"
],
"cwd": "/opt/RPiDemo",
"stopAtEntry": false,
"console": "internalConsole",
"pipeTransport": {
"pipeCwd": "${workspaceRoot}",
"pipeProgram": "ssh",
"pipeArgs": [
"-T",
"-p", "2222",
"root@192.168.81.129"
],
"quoteArgs": true,
"debuggerPath": "/usr/bin/vsdbg/vsdbg"
},
"logging": {
"engineLogging": true,
"programOutput": true,
"exceptions": true
}
},
]
}
Expected Behavior
Debugger should launch and attach to the process on the RPi and provide debug information to VS Code.
Actual Behavior
Debugger prints the following error message: Unable to attach to CoreCLR. Unknown Error: 0x80131c4f
.
I have then enabled logging via "engineLogging": true,
to obtain more details (as shown in the log below).
I’d like to note, that the console project works perfectly both locally on the Win 10 x64 host and also when being launched manually on the RPi via the dotnet RPiDemo.dll
command (directly in the published directory ‘/opt/RPiDemo’).
Logs
OmniSharp log
Environment information
VSCode version: 1.51.1 C# Extension: 1.23.6
Dotnet Information
.NET SDK (reflecting any global.json): Version: 5.0.100 Commit: 5044b93829Runtime Environment: OS Name: Windows OS Version: 10.0.19042 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.100\
Host (useful for support): Version: 5.0.0 Commit: cf258a14b7
.NET SDKs installed: 2.1.701 [C:\Program Files\dotnet\sdk] 2.1.801 [C:\Program Files\dotnet\sdk] 2.2.207 [C:\Program Files\dotnet\sdk] 2.2.401 [C:\Program Files\dotnet\sdk] 5.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
code-runner | formulahendry | 0.11.1 |
cpptools | ms-vscode | 1.1.1 |
csharp | ms-dotnettools | 1.23.6 |
EditorConfig | EditorConfig | 0.15.1 |
gitlens | eamodio | 11.0.1 |
Ionide-fsharp | Ionide | 4.17.0 |
jupyter | ms-toolsai | 2020.11.358541065 |
markdown-all-in-one | yzhang | 3.4.0 |
path-intellisense | christian-kohler | 2.3.0 |
powershell | ms-vscode | 2020.6.0 |
python | ms-python | 2020.11.358366026 |
remote-containers | ms-vscode-remote | 0.148.1 |
remote-ssh | ms-vscode-remote | 0.56.0 |
remote-ssh-edit | ms-vscode-remote | 0.56.0 |
remote-wsl | ms-vscode-remote | 0.51.3 |
resourcemonitor | mutantdino | 1.0.7 |
vscode-icons | vscode-icons-team | 11.0.0 |
vsliveshare | ms-vsliveshare | 1.0.3121 |
xml | DotJoshJohnson | 2.5.1 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
This has now been fixed by the .NET team. It will work when the target app is running on .NET 5.0.2+.
I think I have the same problem