vscode-csharp: connection to server is erroring

Type: Bug

Steps to reproduce:

  1. Open any tModLoader project
  2. Hover over any part of the code

Results:

[Error - 10:00:32 PM] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server.
[Error - 10:00:32 PM] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server.
[Error - 10:00:32 PM] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server.
[Error - 10:00:32 PM] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server.
[Error - 10:00:34 PM] Stopping server timed out
[Error - 10:00:34 PM] Stopping server failed
Error: Stopping the server timed out
	at /home/neoncube/.vscode/extensions/ms-dotnettools.csharp-2.0.312/dist/extension.js:2:2236900
[Error - 10:00:34 PM] Stopping server failed
Error: Stopping the server timed out
	at /home/neoncube/.vscode/extensions/ms-dotnettools.csharp-2.0.312/dist/extension.js:2:2236900
[Error - 10:00:34 PM] Stopping server failed
Error: Stopping the server timed out
	at /home/neoncube/.vscode/extensions/ms-dotnettools.csharp-2.0.312/dist/extension.js:2:2236900
[Error - 10:00:34 PM] Stopping server failed
Error: Stopping the server timed out
	at /home/neoncube/.vscode/extensions/ms-dotnettools.csharp-2.0.312/dist/extension.js:2:2236900

Extension version: 2.0.312 VS Code version: Code 1.80.2 (2ccd690cbff1569e4a83d7c43d45101f817401dc, 2023-07-27T20:41:52.615Z) OS version: Linux x64 6.2.6-76060206-generic Modes:

System Info
Item Value
CPUs Intel® Core™ i5-6500 CPU @ 3.20GHz (4 x 3299)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 2, 2, 2
Memory (System) 15.49GB (8.31GB free)
Process Argv –unity-launch --crash-reporter-id 2111c801-069c-42bd-b011-46e56007b987
Screen Reader no
VM 0%
DESKTOP_SESSION pop
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP pop
XDG_SESSION_TYPE x11
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931cf:30280410
vshan820:30294714
vstes263:30335439
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263cf:30792227
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
vscccc:30803845
282f8724:30602487
f6dab269:30613381
vscrpc:30673769
showlangstatbar:30737416
vsctsb:30748421
03d35959:30757346
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixshowwlkth:30771522
showindicator:30785052
pythongtdpath:30769146
i26e3531:30792625
gsofb:30804716
pythonnosmt12:30797651
pythonnoceb:30797650
e537b577:30795824
dsvsc013:30795093
dsvsc014:30804076
cmakestatusbarv2:30779594

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

I meet the same problem.

dotnet --list-sdks
6.0.413 [/usr/local/share/dotnet/sdk]
7.0.304 [/usr/local/share/dotnet/sdk]
"dotnetAcquisitionExtension.existingDotnetPath": [
        {
            "extensionId": "ms-dotnettools.csharp",
            "path": "/usr/local/share/dotnet/dotnet"
        },
        {
            "extensionId": "ms-dotnettools.csdevkit",
            "path": "/usr/local/share/dotnet/dotnet"
        },
        {
            "extensionId":"ms-dotnettools.vscodeintellicode-csharp",
            "path":"/usr/local/share/dotnet/dotnet"
        }
    ]

I can’t fix it

I’ve been having a similar problem as @beta1scat… I have the newest version .net 7.0.306 downloaded, but perhaps it’s looking in the wrong location?

2023-08-30 20:31:38.137 [info] No .NET SDKs were found.

Download a .NET SDK:
https://aka.ms/dotnet/download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found

2023-08-30 20:31:38.151 [info] Additional information of .NET SDKs for diagnostic.NET SDK:
 Version:   7.0.306
 Commit:    f500069cb7

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /snap/dotnet-sdk/216/sdk/7.0.306/

Host:
  Version:      7.0.9
  Architecture: x64
  Commit:       8e9a17b221

.NET SDKs installed:
  7.0.306 [/snap/dotnet-sdk/216/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.9 [/snap/dotnet-sdk/216/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.9 [/snap/dotnet-sdk/216/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

2023-08-30 20:31:44.201 [info] Project system initialization finished. 0 project(s) are loaded, and 5 failed to load.

The output:

Using dotnet configured on PATH
Dotnet path: /usr/bin/snap
Activating C# + C# Dev Kit + C# IntelliCode...
[Error - 8:38:08 PM] Client Microsoft.CodeAnalysis.LanguageServer: connection to server is erroring. Shutting down server.
[Error - 8:38:08 PM] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: starting
	at s.shutdown (/home/mimi/.vscode/extensions/ms-dotnettools.csharp-2.0.436-linux-x64/dist/extension.js:2:2252253)
	at s.stop (/home/mimi/.vscode/extensions/ms-dotnettools.csharp-2.0.436-linux-x64/dist/extension.js:2:2251834)
	at s.stop (/home/mimi/.vscode/extensions/ms-dotnettools.csharp-2.0.436-linux-x64/dist/extension.js:2:2415006)
	at s.handleConnectionError (/home/mimi/.vscode/extensions/ms-dotnettools.csharp-2.0.436-linux-x64/dist/extension.js:2:2258341)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[Error - 8:38:08 PM] Server initialization failed.
  Message: write EPIPE
  Code: -32099 
[Error - 8:38:08 PM] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.
  Message: write EPIPE
  Code: -32099 
[Info  - 8:38:08 PM] Connection to server got closed. Server will restart.
true
You must install .NET to run this application.

App: /home/mimi/.vscode/extensions/ms-dotnettools.csharp-2.0.436-linux-x64/.roslyn/Microsoft.CodeAnalysis.LanguageServer
Architecture: x64
App host version: 7.0.0-preview.7.22362.8
.NET location: Not found

Learn about runtime installation:
https://aka.ms/dotnet/app-launch-failed

Download the .NET runtime:
https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=ubuntu.22.04-x64&apphost_version=7.0.0-preview.7.22362.8

…And it repeats several times. Notably the Dotnet path /usr/bin/snap doesn’t match any of my paths that I’ve set up and doesn’t have a dotnet version when i navigated there and checked with? I’ve been trying to change the path by fiddling with it in settings, but nothing comes about…

@Neon-Cube mentioned setting the dotnet path in the settings, may I inquire which field that is specifically?? Here are my settings now:

{
    "omnisharp.monoPath": "/usr/bin/mono",
    "omnisharp.sdkIncludePrereleases": false,
    "omnisharp.sdkPath": "/snap/dotnet-sdk/216/sdk/7.0.306",
    "omnisharp.useModernNet": false,
    "dotnet.server.useOmnisharp": true,
    "omnisharp.dotNetCliPaths": [
        "/snap/bin/dotnet"
    ],
    "dotnet.defaultSolution": "/snap/bin/",
    "dotnet.unitTestDebuggingOptions": {

    },
    "dotnetAcquisitionExtension.existingDotnetPath": [
        "/snap/bin/dotnet"
    ]
}

Now I did check that snap/root has the correct version which is why I set it so. I’m a bit of a newbie so I do apologize if I mixed up any of the paths ^_^;

@beta1scat,

As @dibarbet said,

That’s fine - it means its running correctly - I need to add a log item here that indicates it is started because the current log is pretty misleading.

Thanks for your reply, I have already install dotnet 7.0, but when I open vscode, it also Dowloading the .NET Runtime. Should I set up something else?

To confirm, do you still have the dotnetAcquisitionExtension.existingDotnetPath in your settings pointing to /usr/share/dotnet?