dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.85k stars 669 forks source link

vscode stop debugging/running any dotnet core apps #3676

Closed caglardursun closed 3 months ago

caglardursun commented 4 years ago

VScode Log :

[renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms at t.RawDebugSession.handleErrorResponse (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:952) at file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:250 at async t.RawDebugSession.shutdown (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2951:336)

Please paste the output from your clipboard.NET Core SDK (reflecting any global.json): Version: 3.1.200 Commit: c5123d973b

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

Host (useful for support): Version: 3.1.2 Commit: 916b5cba26

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

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

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

VS Code version: Version: 1.43.0 Commit: 78a4c91400152c0f27ba4d363eb56d2835f9903a Date: 2020-03-09T19:44:52.965Z Electron: 7.1.11 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Linux x64 5.3.0-42-generic

C# Extension version : 1.21.4

Installed Extensions : eamodio.gitlens ms-azuretools.vscode-docker ms-vscode.cmake-tools ms-vscode.cpptools twxs.cmake vscode-icons-team.vscode-icons

JoeRobich commented 4 years ago

@caglardursun Can you provide steps to reproduce this issue?

cc: @WardenGnaw

caglardursun commented 4 years ago

I just install the c# extension. That's all.

When I first install the extension, everything looks fine. But after that (I just close the vscode and open again) I hit the F5 it looks like compiling but a few seconds later, start and stop button group is gone.

I thought there is a application crash but it's not. I thought there was a vscode problem but I can compile and debug cpp application easily

So I assume the problem should be about the extension I try to downgrade the extension version, I try to delete whole ~/.vscode/extension folder and reinstall again but none of them worked.

WardenGnaw commented 4 years ago

Could you enable logging and share those logs?

You can do this by adding the following to your launch.json:

"logging": {
   "engineLogging": true
}
caglardursun commented 4 years ago

I added into configuration section in launch file. I've just open window log

[2020-03-17 22:48:19.794] [renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms at t.RawDebugSession.handleErrorResponse (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:952) at file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:250 at async t.RawDebugSession.shutdown (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2951:336) [2020-03-17 23:07:56.618] [renderer1] [error] An unknown error occurred. Please consult the log for more details. [2020-03-17 23:24:23.456] [renderer1] [error] Cannot read property 'type' of undefined: TypeError: Cannot read property 'type' of undefined at Module.e (/home/caglar/.vscode/extensions/ms-vscode-remote.remote-containers-0.106.0/dist/extension.js:1:56525) at t.ConfigLinkProvider.provideDocumentLinks (/home/caglar/.vscode/extensions/ms-vscode-remote.remote-containers-0.106.0/dist/extension.js:1:1141412) at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:600:40 at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:54:345 at new Promise (<anonymous>) at Object.t.asPromise (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:54:317) at U.provideLinks (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:600:11) at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:614:274 at V._withAdapter (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:604:832) at V.$provideDocumentLinks (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:614:252) at p._doInvokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:688:464) at p._invokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:688:156) at p._receiveRequest (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:686:766) at p._receiveOneMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:685:623) at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:683:791 at l.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:48:845) at v.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:191:325) at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:851:104 at l.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:48:845) at v.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:191:325) at t.PersistentProtocol._receiveMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:195:717) at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:192:897 at l.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:48:845) at p.acceptChunk (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:188:897) at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:188:249 at Socket.t (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:197:232) at Socket.emit (events.js:203:13) at addChunk (_stream_readable.js:295:12) at readableAddChunk (_stream_readable.js:276:11) at Socket.Readable.push (_stream_readable.js:210:10) at Pipe.onStreamRead (internal/stream_base_commons.js:166:17) [2020-03-17 23:40:10.367] [renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms at t.RawDebugSession.handleErrorResponse (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:952) at file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:250 at async t.RawDebugSession.shutdown (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2951:336) [2020-03-17 23:40:14.378] [renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms at t.RawDebugSession.handleErrorResponse (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:952) at file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:250 at async t.RawDebugSession.shutdown (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2951:336) [2020-03-18 00:00:34.851] [renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms at t.RawDebugSession.handleErrorResponse (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:952) at file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:250 at async t.RawDebugSession.shutdown (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2951:336) [2020-03-18 00:00:48.690] [renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms at t.RawDebugSession.handleErrorResponse (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:952) at file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:250 at async t.RawDebugSession.shutdown (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2951:336) [2020-03-18 00:02:19.465] [renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms at t.RawDebugSession.handleErrorResponse (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:952) at file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:250 at async t.RawDebugSession.shutdown (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2951:336) [2020-03-18 00:03:43.769] [renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms at t.RawDebugSession.handleErrorResponse (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:952) at file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:250 at async t.RawDebugSession.shutdown (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2951:336) [2020-03-18 00:06:21.305] [renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms at t.RawDebugSession.handleErrorResponse (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:952) at file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:250 at async t.RawDebugSession.shutdown (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2951:336)

caglardursun commented 4 years ago

Now same error occurred

[2020-03-18 00:13:22.104] [renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms at t.RawDebugSession.handleErrorResponse (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:952) at file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2953:250 at async t.RawDebugSession.shutdown (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2951:336)

WardenGnaw commented 4 years ago

Sorry, could you share the logs from the Debug Console pane? It will look like:

<- (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":{}}
caglardursun commented 4 years ago

I couldn't see anything on the debug console. It's blank

WardenGnaw commented 4 years ago

Unfortunately, that means the C# debugger does not start up and did not get a request to debug any process.

From the logs provided earlier, there seems to be an error from the ms-vscode-remote.remote-containers-0.106.0 extension.

[2020-03-17 23:07:56.618] [renderer1] [error] An unknown error occurred. Please consult the log for more details. [2020-03-17 23:24:23.456] [renderer1] [error] Cannot read property 'type' of undefined: TypeError: Cannot read property 'type' of undefined at Module.e
caglardursun commented 4 years ago

But before the extension installed, I already cannot debug the app. The same thing happened. Since I cannot keep going on normal debugging, I switch the docker and I try to remote debugging on the container that's all.

It's not relevant with the remote debugging

caglardursun commented 4 years ago

All right, I clean up entire extension folder. rm -rf ~/.vscode/extensions/ I installed C# extension again there is only one folder in extensions folder ms-dotnettools.csharp-1.21.14

here is my launch.json file

{
   // Use IntelliSense to find out which attributes exist for C# debugging
   // Use hover for the description of the existing attributes
   // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
   "version": "0.2.0",
   "configurations": [
        {
            "logging": {
                "engineLogging": true
            },
            "name": ".NET Core Launch (web)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            // If you have changed target frameworks, make sure to update the program path.
            "program": "${workspaceFolder}/bin/Debug/netcoreapp3.0/BlaBlaMail.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false,
            // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
            "serverReadyAction": {
                "action": "openExternally",
                "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"                
            },
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development"
            },
            "sourceFileMap": {
                "/Views": "${workspaceFolder}/Views"
            }
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command:pickProcess}"
        }
    ]
}

Installing C# dependencies... Platform: linux, x86_64, name=ubuntu, version=19.10

Downloading package 'OmniSharp for Linux (x64)' (43753 KB).................... Done! Validating download... Integrity Check succeeded. Installing package 'OmniSharp for Linux (x64)'

Downloading package '.NET Core Debugger (linux / x64)' (54207 KB).................... Done! Validating download... Integrity Check succeeded. Installing package '.NET Core Debugger (linux / x64)'

Downloading package 'Razor Language Server (Linux / x64)' (52181 KB).................... Done! Installing package 'Razor Language Server (Linux / x64)'

Finished

caglardursun commented 4 years ago

Nope ... Debug console is still clean

WardenGnaw commented 4 years ago

Can you run the following ~/.vscode/extensions/ms-dotnettools.csharp-1.21.14/.debugger/vsdbg-ui?

There should be an output saying: Waiting on communicatoin on stdin/stdout....

Also, does dotnet run work in your CLI?

caglardursun commented 4 years ago

dotnet run works properly there is no problem And Waiting for communication on stdin/stdout... appeared What else I can try to solve this problem permanently ?

caglardursun commented 4 years ago

I faced the same problem after installing VSCode insiders btw. May be this can give you a hint ...

MartinIsla commented 4 years ago

I have this exact issue! I have Ubuntu 19.10 too. What could it be?

WardenGnaw commented 4 years ago

@caglardursun I got failures with VSCode Insiders.

The issues I was running into was that dotnet would fail to run and it wouldn't start the debugger.

Can you try running dotnet build for your project in the command line, in your launch.json can you remove the "preLaunchTask": "build", and then try running the debugger?

caglardursun commented 4 years ago

Nope Not worked at all. Then I try to kill the process using

ps aux | grep dotnet the output was ...

caglar 3848 0.0 0.0 12208 3568 ? S 16:04 0:00 bash /home/caglar/.vscode/extensions/ms-dotnettools.csharp-1.21.14/.omnisharp/1.34.14/run -s /home/caglar/Development/Work/penMail/PenMail/PenMail.sln --hostPID 3592 DotNet:enablePackageRestore=false --encoding utf-8 --loglevel information --plugin /home/caglar/.vscode/extensions/ms-dotnettools.csharp-1.21.14/.razor/OmniSharpPlugin/Microsoft.AspNetCore.Razor.OmniSharpPlugin.dll FileOptions:SystemExcludeSearchPatterns:0=*/.git FileOptions:SystemExcludeSearchPatterns:1=/.svn FileOptions:SystemExcludeSearchPatterns:2=/.hg FileOptions:SystemExcludeSearchPatterns:3=/CVS FileOptions:SystemExcludeSearchPatterns:4=*/.DS_Store formattingOptions:useTabs=false formattingOptions:tabSize=4 formattingOptions:indentationSize=4 caglar 3852 41.5 1.7 2740960 281236 ? Sl 16:04 0:06 /home/caglar/.vscode/extensions/ms-dotnettools.csharp-1.21.14/.omnisharp/1.34.14/bin/mono /home/caglar/.vscode/extensions/ms-dotnettools.csharp-1.21.14/.omnisharp/1.34.14/omnisharp/OmniSharp.exe -s /home/caglar/Development/Work/penMail/PenMail/PenMail.sln --hostPID 3592 DotNet:enablePackageRestore=false --encoding utf-8 --loglevel information --plugin /home/caglar/.vscode/extensions/ms-dotnettools.csharp-1.21.14/.razor/OmniSharpPlugin/Microsoft.AspNetCore.Razor.OmniSharpPlugin.dll FileOptions:SystemExcludeSearchPatterns:0=*/.git FileOptions:SystemExcludeSearchPatterns:1=/.svn FileOptions:SystemExcludeSearchPatterns:2=/.hg FileOptions:SystemExcludeSearchPatterns:3=/CVS FileOptions:SystemExcludeSearchPatterns:4=*/.DS_Store formattingOptions:useTabs=false formattingOptions:tabSize=4 formattingOptions:indentationSize=4 caglar 3935 2.2 0.4 567372 71120 ? Sl 16:04 0:00 /snap/code/27/usr/share/code/code /snap/code/27/usr/share/code/resources/app/out/bootstrap-fork ms-dotnettools.coreclr {"common.vscodemachineid":"03a8d84bf949581c8fcf13b04eda73709226233aa144c78471c72e92c6f8ed93","common.vscodesessionid":"698de98a-ec31-4674-b9c7-80f702a16fe41584623093723"} AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217 caglar 4044 0.0 0.0 11768 984 pts/0 S+ 16:05 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox dotnet

I kill the each process using sudo kill pid even it is Omnisharp. Then I open up Code again. I remove the preLaunchTask section. I assumed, VsCode should already builded with dotnet build command in background before. Then I press the F5.

Not worked again

blyaloc commented 4 years ago

do we need to downgrade ubuntu 19 to ubuntu 18 LTS? please advice

husseinraoouf commented 4 years ago

also happing with me :pensive:

additional information: vscode: 1.44.1 C# extension: 1.22.0 omnisharp-roslyn: 1.35.1

gregg-miskelly commented 4 years ago

@husseinraoouf I am not sure your problem is actually the same as what was originally reported (it is pretty generic). But if you want to provide a debugger log and a more detailed description on what you are seeing we can have a look.

husseinraoouf commented 4 years ago

@gregg-miskelly sorry i wan't clear yes the same problem originally reported

the Debug console is blank but here is the vscode log

[2020-06-02 19:27:42.324] [renderer3] [error] timeout after 1000 ms: Error: timeout after 1000 ms
    at t.RawDebugSession.handleErrorResponse (file:///nix/store/idn0plil2hj6y5frsykmqs16pmbfi5aa-vscode-1.44.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3044:67)
    at file:///nix/store/idn0plil2hj6y5frsykmqs16pmbfi5aa-vscode-1.44.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3043:339
    at async t.RawDebugSession.shutdown (file:///nix/store/idn0plil2hj6y5frsykmqs16pmbfi5aa-vscode-1.44.1/lib/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3041:336)
gregg-miskelly commented 4 years ago

@husseinraoouf if you would like help, please include a debugger log.

husseinraoouf commented 4 years ago

@gregg-miskelly it is empty, I think the debugger is not even started

yeahbah commented 4 years ago

Similar problem here in Manjaro 20, Code OSS 1.48, dotnet 3.1.107

<- (R) {"seq":4,"type":"response","request_seq":2,"success":true,"command":"launch"} <- (E) {"seq":5,"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":"d241e93b","VS.Diagnostics.Debugger.vsdbg.Command":"handshake","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.6.20415.1 commit:0184bb70e1ed40656c0dfa53125805036207007b"}}} <- (R) {"seq":6,"type":"response","request_seq":1,"success":false,"command":"handshake","message":"Error processing 'handshake' request. Unknown Error: 0x89720010"}

gregg-miskelly commented 4 years ago

@yeahbah your issue is not related to this. My guess is that your problem is that you are using the OSS version of Visual Studio Code. The debugger is only licensed to work in the official version of VS Code. If you are using the official version of VS Code, please open a new issue and we can try to figure out what is going on.

gregg-miskelly commented 3 months ago

Closing out stale issue