Skip to content
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

Arch: Debugging just stops when trying to print out "Hello World!" #2819

Closed
CTJansson opened this issue Jan 27, 2019 · 15 comments
Closed

Arch: Debugging just stops when trying to print out "Hello World!" #2819

CTJansson opened this issue Jan 27, 2019 · 15 comments
Labels

Comments

@CTJansson
Copy link

Environment data

dotnet --info:

.NET Core SDK (reflecting any global.json):
 Version:   2.2.102
 Commit:    96ff75a873

Runtime Environment:
 OS Name:     antergos
 OS Version:  
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /opt/dotnet/sdk/2.2.102/

Host (useful for support):
  Version: 2.2.1
  Commit:  878dd11e62

.NET Core SDKs installed:
  2.2.102 [/opt/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.NETCore.App 2.2.1 [/opt/dotnet/shared/Microsoft.NETCore.App]

VS Code version:

Version: 1.30.2
Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
Date: 2019-01-08T23:10:56.746Z
Electron: 2.0.16
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Linux x64 4.20.4-arch1-1-ARCH

C# Extension version:
1.17.1

Steps to reproduce

  1. Create a console application, dotnet new console
    i. Worth to mention, running dotnet build and dotnet run works without problems
  2. Open your console application folder into your workspace, create your default launch.json and task.json
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/bin/Debug/netcoreapp2.2/test.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "console": "internalConsole",
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart"
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command:pickProcess}"
        }
        {
            "label": "build",
            "command": "dotnet build",
            "type": "shell",
            "group": "build",
            "presentation": {
                "reveal": "silent"
            },
            "problemMatcher": "$msCompile"
        }
  1. Press F5 to start debug

Expected behavior

Starts debugger and Print out "Hello world" in the debug console

Actual behavior

After the preLaunchTask, the debugger just stops without any error output and not printing "Hello World!" in the debug console.

@gregg-miskelly
Copy link
Contributor

Can you enable logging and see what gets printed?

@CTJansson
Copy link
Author

Can you enable logging and see what gets printed?

Sure will do when I get home from work in 8-10 hours

@jchand99
Copy link

jchand99 commented Jan 28, 2019

Enabling the logging didn't seem to do anything. The log file either never got created or I just couldn't find it. Although I did try to set the directory and file name but still, no file was created.

What fixed it for me was a solution from a different issue :

  1. Uninstall the C# Plugin & close VSCode
  2. Go to ~/.vscode/extensions/ and remove the entire ms-vscode.csharp- folder
  3. Re-open VSCode and install the extension again, it then downloads the updates and debugging with F5 works again.

edit: extension not plugin

@gregg-miskelly
Copy link
Contributor

Glad you figured it out!

@CTJansson
Copy link
Author

I did the steps jchand99 mentioned but didn't solve it for me, I still can't print out when running a simple hello world console app.
Anyway here is a log that was outputed in the debug console when logging was set to true:

-> (C) {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Code - OSS","adapterID":"coreclr","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us"},"type":"request","seq":1}
-> (C) {"command":"launch","arguments":{"logging":{"engineLogging":false},"name":".NET Core Launch (console)","type":"coreclr","request":"launch","preLaunchTask":"build","program":"/home/kokefa/programming/test/bin/Debug/netcoreapp2.2/test.dll","args":[],"cwd":"/home/kokefa/programming/test","console":"internalConsole","stopAtEntry":false,"internalConsoleOptions":"openOnSessionStart","__sessionId":"4a64e018-c61c-41a3-802d-a6f46ff8e42f"},"type":"request","seq":2}
<- (E) {"seq":3,"type":"event","event":"output","body":{"category":"console","output":"-------------------------------------------------------------------\nYou may only use the Microsoft .NET Core Debugger (vsdbg) with\nVisual Studio Code, Visual Studio or Visual Studio for Mac software\nto help you develop and test your applications.\n-------------------------------------------------------------------\n"}}
-------------------------------------------------------------------
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.
-------------------------------------------------------------------
<- (R) {"seq":4,"type":"response","request_seq":2,"success":true,"command":"launch"}
<- (E) {"seq":5,"type":"event","event":"initialized","body":{}}
<- (E) {"seq":6,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/CommandFailed","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.ErrorCode":-1989017584,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"antergos","VS.Diagnostics.Debugger.vsdbg.Command":"handshake","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.0.11026.1 commit:87122b596f240c8c819a194d8f57eb6c749483b9"}}}
-> (C) {"command":"setExceptionBreakpoints","arguments":{"filters":["all","user-unhandled"]},"type":"request","seq":4}
<- (R) {"seq":7,"type":"response","request_seq":3,"success":false,"command":"handshake","message":"Error processing 'handshake' request. Unknown Error: 0x89720010"}
<- (R) {"seq":8,"type":"response","request_seq":4,"success":true,"command":"setExceptionBreakpoints"}
-> (C) {"command":"configurationDone","type":"request","seq":5}
<- (E) {"seq":9,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/CommandFailed","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.ErrorCode":17001,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"antergos","VS.Diagnostics.Debugger.vsdbg.Command":"handshake","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.0.11026.1 commit:87122b596f240c8c819a194d8f57eb6c749483b9"}}}
<- (E) {"seq":10,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/DebugCompleted","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.DebugCompleted.BreakCounter":0,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"antergos","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.0.11026.1 commit:87122b596f240c8c819a194d8f57eb6c749483b9"}}}
<- (R) {"seq":11,"type":"response","request_seq":5,"success":false,"command":"configurationDone","message":"Error processing 'configurationDone' request. Unknown Error: 0x89720010"}
-> (C) {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":6}
-> (C) {"command":"threads","type":"request","seq":7}
<- (E) {"seq":12,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/DebugCompleted","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.DebugCompleted.BreakCounter":0,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"antergos","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.0.11026.1 commit:87122b596f240c8c819a194d8f57eb6c749483b9"}}}

@gregg-miskelly
Copy link
Contributor

@CTJansson are you using a version of VS Code which was built by someone other than Microsoft? (non-official copy)

@jchand99
Copy link

Do you have the package "msbuild-stable" installed @CTJansson? I've had issues in some projects when that package isn't installed.

@gregg-miskelly
Copy link
Contributor

The issue that @CTJansson is running into is this --
{"seq":7,"type":"response","request_seq":3,"success":false,"command":"handshake","message":"Error processing 'handshake' request. Unknown Error: 0x89720010"}

This either means that @CTJansson is using an unofficial version of VS Code, or VS Code is failing to process this request.

@CTJansson
Copy link
Author

CTJansson commented Jan 28, 2019

@gregg-miskelly well, it seems I did, I installed the one from arch repository (this is the one causing problems), checked if AUR had a package and sure it did, that one works, so the issue can be closed again.
Thanks for the help though, never had a thought on checking AUR for vscode when it was in the official repo.
(Note for others incl myself, don't install vs code from arch repo, install the one from AUR)

@FFY00
Copy link

FFY00 commented Mar 15, 2019

(archlinux packager here)

Yeah, I am sorry but we are sane people so we run vscode with the electron already installed on your system, we don't package a new copy of electron specifically to run vscode (electron is huge btw). I already had a conversation with the upstream but they won't fix it, because they don't want, really. I guess it bothers them to much to spend a few hours tracking down here they are mishandling the spawning of new instances. Please open an issue with vscode's upstream, if people don't bother them this won't ever get fixed. This is what it looks when Microsoft opensources something.

@aude
Copy link

aude commented May 8, 2019

@FFY00, I'd love to use the arch packaged vscode, not the Microsoft packaged one in AUR. If for nothing else, for the updates.

What is the exact thing stopping vsdbg from working with arch packaged vscode?

I thought it was https://aka.ms/VSCode-DotNet-DbgLicense. But please correct me if I'm wrong.

@FFY00
Copy link

FFY00 commented May 8, 2019

I explain the reason it doesn't work in the comment above.

@aude
Copy link

aude commented May 8, 2019

Does it really not work because arch uses the system electron instead of the bundled one? That sounds unlikely.

To me, it sounds more likely that Microsoft signs something in their own vscode releases, so that vsdbg can detect whether it's "authentic" or not. Or some similar method.

@FFY00
Copy link

FFY00 commented May 8, 2019

VS Code doesn't handle respawns properly when called using the electron binary. If you want to try it yourself you can confirm it is working by compiling vscode yourself. Microsoft is not being stuborn, they are just ignoring the community because that doesn't give them instant PR publicity.

@aude
Copy link

aude commented May 9, 2019

Oh, thanks for the explanation. I misunderstood, I was talking about a different issue, my bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants