Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft.CodeAnalysis.LanguageServer client: Couldn't connect to server (Source: C# [Extension])

OS: Ubuntu 22.04.3 VSCode: 1.83

Every time I open Visual Studio Code, an error pops up saying "Microsoft.CodeAnalysis.LanguageServer client: Couldn't connect to server (Source: C# [Extension])".

Intellisense does not work for C# either, and I am unsure if it has to do with this error.

The following is the output:

Using dotnet configured on PATH
Dotnet path: /usr/bin/snap
Activating C# + C# Dev Kit + C# IntelliCode...
waiting for named pipe information from server...
[stderr] error: unknown command "/home/alex/.vscode/extensions/ms-dotnettools.csharp-2.6.24-linux-x64/.roslyn/Microsoft.CodeAnalysis.LanguageServer.dll", see 'snap help'.
Language server process exited with 64
[Error - 10:30:55 AM] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.

I don't know what is causing it. I have tried reinstalling VSCode and reinstalling my extensions. I have checked the filepath of the unknown command to see if the file was missing for some reason, but it is present.

like image 436
Alex White Avatar asked Mar 22 '26 21:03

Alex White


2 Answers

According to this issue on github.

You can try to delete the folder found in (command 'open extensions folder'). Then reinstall the C# extension.

like image 166
MingJie-MSFT Avatar answered Mar 24 '26 12:03

MingJie-MSFT


In my case (OS: mac os x apple silicon) The settings for the C# extension had a wrong path for the "Dotnet Path" setting. It had added /dotnet in front of existing path somehow after the update.

The path with issue looked like this: /usr/local/share/dotnet/dotnet

what fixed the issue for me is to change that path to: /usr/local/share/dotnet

here is the example setting: example extension setting vacode on apple macbook m2

like image 25
mna Avatar answered Mar 24 '26 12:03

mna



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!