dotnet / dotnet/vscode-csharp

Unit test debugging: "Unable to attach to CoreCLR." error

Open
#4,405 3 comments 0 reactions 0 assignees View on GitHub
OmniSharp Test
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
18h 40m
Merged PRs (30d)
31

Description

## Environment data
`dotnet --info` output:
```
.NET Core SDK (reflecting any global.json):
Version: 3.1.406
Commit: a36050195a

Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/3.1.406/

Host (useful for support):
Version: 3.1.12
Commit: 0267ad09c6

.NET Core SDKs installed:
3.1.406 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.23 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.23 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.12 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.23 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.12 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
```

VS Code version:
```
1.53.2
622cb03f7e070a9670c94bae1a45d78d7181fbd4
x64
```

C# Extension version:
```v1.23.9``` (Omnisharp)

## OmniSharp log
```
Starting OmniSharp server at 2/19/2021, 2:38:50 AM
Target: /home/azureuser/Documents/iotedge/test/modules/Modules.Test

OmniSharp server started.
Path: /home/azureuser/.vscode-server/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.6/run
PID: 30691

[info]: OmniSharp.Stdio.Host
Starting OmniSharp on ubuntu 18.4 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.8.0 - "/home/azureuser/.vscode-server/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.6/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/azureuser/.vscode-server/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.6/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.8.0 - "/home/azureuser/.vscode-server/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.6/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /home/azureuser/.vscode-server/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.6/omnisharp/.msbuild/Current/Bin
CscToolPath = /home/azureuser/.vscode-server/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.6/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /home/azureuser/.vscode-server/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.6/omnisharp/.msbuild
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/azureuser/Documents/iotedge/test/modules/Modules.Test'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/home/azureuser/Documents/iotedge/test/modules/Modules.Test'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/azureuser/Documents/iotedge/test/modules/Modules.Test/Modules.Test.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/azureuser/Documents/iotedge/test/modules/Modules.Test'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/azureuser/Documents/iotedge/test/modules/Modules.Test' on host 30570.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/azureuser/Documents/iotedge/test/modules/Modules.Test/Modules.Test.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/azureuser/Documents/iotedge/test/modules/Modules.Test/Modules.Test.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/home/azureuser/Documents/iotedge/test/modules/Modules.Test/Modules.Test.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Update project: Modules.Test
[info]: OmniSharp.MSBuild.ProjectManager
Found referenced project outside root directory: /home/azureuser/Documents/iotedge/test/modules/ModuleLib/Microsoft.Azure.Devices.Edge.ModuleUtil.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/home/azureuser/Documents/iotedge/test/modules/ModuleLib/Microsoft.Azure.Devices.Edge.ModuleUtil.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/azureuser/Documents/iotedge/test/modules/ModuleLib/Microsoft.Azure.Devices.Edge.ModuleUtil.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Found referenced project outside root directory: /home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Storage/Microsoft.Azure.Devices.Edge.Storage.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Storage/Microsoft.Azure.Devices.Edge.Storage.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Storage/Microsoft.Azure.Devices.Edge.Storage.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Found referenced project outside root directory: /home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Storage.RocksDb/Microsoft.Azure.Devices.Edge.Storage.RocksDb.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Storage.RocksDb/Microsoft.Azure.Devices.Edge.Storage.RocksDb.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Storage.RocksDb/Microsoft.Azure.Devices.Edge.Storage.RocksDb.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Found referenced project outside root directory: /home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Util/Microsoft.Azure.Devices.Edge.Util.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Util/Microsoft.Azure.Devices.Edge.Util.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Util/Microsoft.Azure.Devices.Edge.Util.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Found referenced project outside root directory: /home/azureuser/Documents/iotedge/edge-util/test/Microsoft.Azure.Devices.Edge.Util.Test.Common/Microsoft.Azure.Devices.Edge.Util.Test.Common.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/home/azureuser/Documents/iotedge/edge-util/test/Microsoft.Azure.Devices.Edge.Util.Test.Common/Microsoft.Azure.Devices.Edge.Util.Test.Common.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/azureuser/Documents/iotedge/edge-util/test/Microsoft.Azure.Devices.Edge.Util.Test.Common/Microsoft.Azure.Devices.Edge.Util.Test.Common.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Found referenced project outside root directory: /home/azureuser/Documents/iotedge/test/modules/TestResultCoordinator/TestResultCoordinator.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/home/azureuser/Documents/iotedge/test/modules/TestResultCoordinator/TestResultCoordinator.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/azureuser/Documents/iotedge/test/modules/TestResultCoordinator/TestResultCoordinator.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/azureuser/Documents/iotedge/test/modules/ModuleLib/Microsoft.Azure.Devices.Edge.ModuleUtil.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/azureuser/Documents/iotedge/test/modules/ModuleLib/Microsoft.Azure.Devices.Edge.ModuleUtil.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Storage/Microsoft.Azure.Devices.Edge.Storage.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Storage/Microsoft.Azure.Devices.Edge.Storage.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Storage.RocksDb/Microsoft.Azure.Devices.Edge.Storage.RocksDb.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Storage.RocksDb/Microsoft.Azure.Devices.Edge.Storage.RocksDb.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Util/Microsoft.Azure.Devices.Edge.Util.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/azureuser/Documents/iotedge/edge-util/src/Microsoft.Azure.Devices.Edge.Util/Microsoft.Azure.Devices.Edge.Util.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/azureuser/Documents/iotedge/edge-util/test/Microsoft.Azure.Devices.Edge.Util.Test.Common/Microsoft.Azure.Devices.Edge.Util.Test.Common.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/azureuser/Documents/iotedge/edge-util/test/Microsoft.Azure.Devices.Edge.Util.Test.Common/Microsoft.Azure.Devices.Edge.Util.Test.Common.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/azureuser/Documents/iotedge/test/modules/TestResultCoordinator/TestResultCoordinator.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/azureuser/Documents/iotedge/test/modules/TestResultCoordinator/TestResultCoordinator.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Update project: Microsoft.Azure.Devices.Edge.ModuleUtil
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/stylecop.analyzers.unstable/1.2.0.164/analyzers/dotnet/cs/StyleCop.Analyzers.CodeFixes.dll
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/stylecop.analyzers.unstable/1.2.0.164/analyzers/dotnet/cs/StyleCop.Analyzers.dll
[info]: OmniSharp.MSBuild.ProjectManager
Update project: Microsoft.Azure.Devices.Edge.Storage
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/stylecop.analyzers.unstable/1.2.0.164/analyzers/dotnet/cs/StyleCop.Analyzers.CodeFixes.dll
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/stylecop.analyzers.unstable/1.2.0.164/analyzers/dotnet/cs/StyleCop.Analyzers.dll
[info]: OmniSharp.MSBuild.ProjectManager
Update project: Microsoft.Azure.Devices.Edge.Storage.RocksDb
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/stylecop.analyzers.unstable/1.2.0.164/analyzers/dotnet/cs/StyleCop.Analyzers.CodeFixes.dll
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/stylecop.analyzers.unstable/1.2.0.164/analyzers/dotnet/cs/StyleCop.Analyzers.dll
[info]: OmniSharp.MSBuild.ProjectManager
Update project: Microsoft.Azure.Devices.Edge.Util
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/stylecop.analyzers.unstable/1.2.0.164/analyzers/dotnet/cs/StyleCop.Analyzers.CodeFixes.dll
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/stylecop.analyzers.unstable/1.2.0.164/analyzers/dotnet/cs/StyleCop.Analyzers.dll
[info]: OmniSharp.MSBuild.ProjectManager
Update project: Microsoft.Azure.Devices.Edge.Util.Test.Common
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/stylecop.analyzers.unstable/1.2.0.164/analyzers/dotnet/cs/StyleCop.Analyzers.CodeFixes.dll
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/stylecop.analyzers.unstable/1.2.0.164/analyzers/dotnet/cs/StyleCop.Analyzers.dll
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/xunit.analyzers/0.10.0/analyzers/dotnet/cs/xunit.analyzers.dll
[info]: OmniSharp.MSBuild.ProjectManager
Update project: TestResultCoordinator
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/stylecop.analyzers.unstable/1.2.0.164/analyzers/dotnet/cs/StyleCop.Analyzers.CodeFixes.dll
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: /home/azureuser/.nuget/packages/stylecop.analyzers.unstable/1.2.0.164/analyzers/dotnet/cs/StyleCop.Analyzers.dll
Received response for /quickinfo but could not find request.
[info]: OmniSharp.DotNetTest.VSTestManager
read: {"MessageType":"TestSession.Connected","Payload":null}
[info]: OmniSharp.DotNetTest.VSTestManager
read: {"MessageType":"ProtocolVersion","Payload":1}
[info]: OmniSharp.DotNetTest.DebugSessionManager
Debug session started.
[info]: OmniSharp.DotNetTest.DebugSessionManager
Debug session ended.
```

## Steps to reproduce
1. install dotnet-sdk-3.1 via apt
2. install omnisharp extension
3. attempt to debug any test

This was at one point working on my machine, so I am guessing there was something else I did that broke it.

## Expected behavior
Debugging works and is able to attach to process, then hit my breakpoint.

## Actual behavior
It gives me the following error about CoreCLR. I know that this vsdbg text does not indicate an error. When I click the square stop debug vscode button It then gives the error about ```dotnet has exited```.

Full error:
```
-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
Unable to attach to CoreCLR.
The program '[29455] dotnet' has exited with code -1 (0xffffffff).
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.