Omnisharp-vscode: Can debug 2.2 apps, but not 3.0 apps on macOS and (some?) Linux

Created on 7 Dec 2018  路  14Comments  路  Source: OmniSharp/omnisharp-vscode

Environment data

Mac OS (Mojave)
dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview-009812
 Commit:    e3abf6e935

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.0.100-preview-009812/

Host (useful for support):
  Version: 3.0.0-preview1-27101-02
  Commit:  f1ad6079ca

.NET Core SDKs installed:
  2.1.302 [/usr/local/share/dotnet/sdk]
  2.1.401 [/usr/local/share/dotnet/sdk]
  2.1.500 [/usr/local/share/dotnet/sdk]
  2.2.100-preview1-009349 [/usr/local/share/dotnet/sdk]
  2.2.100-preview2-009404 [/usr/local/share/dotnet/sdk]
  2.2.100-preview3-009430 [/usr/local/share/dotnet/sdk]
  2.2.100 [/usr/local/share/dotnet/sdk]
  3.0.100-preview-009812 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview-18579-0056 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0-preview3-27014-02 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview-27122-01 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

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

VS Code version:
1.29.1

C# Extension version:
1.17.1

Steps to reproduce

mkdir consoleapp22
mkdir consoleapp30
cd consoleapp22
dotnet new global
  • Edit the global.json file to specify the .NET Core 2.2.100 version.
dotnet new razor
code .
  • Open program.cs and put a breakpoint in main.
  • Press F5 to launch the debugger
  • Click the "yes" button when prompted to add stuff to project
  • Select ".NET Core" from the command pallette
  • Press F5 to launch the debugger
  • Debugger stops at breakpoint

    worksin22

  • Allow app to exit

  • Close VS Code
cd ../consoleapp30
dotnet new razor
code .
  • Open program.cs and put a breakpoint in main.
  • Press F5 to launch the debugger
  • Click the "yes" button when prompted to add stuff to project
  • Select ".NET Core" from the command pallette
  • Press F5 to launch the debugger

Expected behavior

The debugger stops at the breakpoint in main in program.cs.

Actual behavior

Debugger never stops at breakpoint.

noworksin30

Bug Debugger Resolved-External

All 14 comments

Thanks for the report! We will have a look.

thanks @gregg-miskelly - if you want to sync up so you can see what my machine is doing let me know. was planning on re-staging this weekend so i got my debugger back but if you need to peek at the environment i can wait.

this machine explodes in 24 hours. 馃挜

I can reproduce your problem on my Mac as well. So I shouldn't need anything more from you. Thanks for opening this!

I found the problem. With .NET Core 3.0 on OSX, the CoreCLR debugging APIs are behaving in a way that they haven't before, and the VS Debugger isn't happy with it. I am working with the CoreCLR team to decide if we should fix VS to be tolerant of this behavior, or if this is a CoreCLR bug.

Thanks for the update, @gregg-miskelly. Keep me posted (even if via email/teams). That explains why it worked on @glennc's computer, as he was running on Windows and I on Mac. cc @damianedwards and @davidfowl FYI.

Two notes:

  1. I ran into this same problem one one of my Linux boxes (but the first one seemed to work fine?)
  2. If anyone really needs to debug with .NET Core 3.0, there is one (unpleasant) work around - you can run the program outside the debugger and attach after the .NET Core runtime has initialized.

I believe I am having the same issue (Ubuntu 18.10), create a web-api project, add some breakpoints to the controller, hit the route, they do not trigger, C# extension installed, tasks and launch json are default as auto generated, says the breakpoints are unverified. I tried the attach process workaround but still am not having any luck.

@edencorbin are you using .NET Core 3.0? If not, you aren't hitting into the same problem, please open a new issue.

@gregg-miskelly, yes should have mentioned that I'm on 3.0. So this is a known vs code issue? I tested on windows Visual Studio Full and it worked great.

You tried it in full Visual Studio on Windows? This is an issue in CoreCLR, it seems to affect macOS, and some Linux distros.

Correct, vscode, .net core 3.0 on ubuntu 18.10, did not work, full Visual Studio on windows 10, .net core 3.0 the debugger did work, stopping at my breakpoints.

Same problem here:
Debugger doesn't stops at breakpoints

Ubuntu 16.04
vscode 1.33.0 (installed from snap)
C# for Visual Studio Code 1.18.0
OmniSharp "omnisharp.path": "latest"
core 3.0.0-preview3-27503-5 (installed from snap)

application created with
dotnet new razorcomponents -o WebApplication1

@kattunga your issue is different, as this issue was resolved by the .NET team for preview-2. Please open a new issue if you would like help understanding what is happening. I will close this one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mshinnie picture mshinnie  路  3Comments

kiminuo picture kiminuo  路  3Comments

gregg-miskelly picture gregg-miskelly  路  3Comments

tstivers1990 picture tstivers1990  路  3Comments

jrmcdona picture jrmcdona  路  3Comments