dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 672 forks source link

OmnisharpServer 1.25.0 with VSCode 1.70.1 compatibility #5344

Open Hackjaku opened 2 years ago

Hackjaku commented 2 years ago

Issue Description

After I upgraded VSCode to version 1.70.1 the plugin stopped working entirely. No intellisense, no debug, nothing. Every entry in the console menu (select project, restart omnisharp etc) returns an error: "Can't read property of undefined". Nothing is printed in the OUTPUT tab. After I removed the ".vscode" folder, if I try to regenerate it, the IDE tells me that OmniSharp server is not running.

All of my .NET projects behave this way (some uses .NET6, some .NET5 and one is still netcore3.1)

Steps to Reproduce

Upgrade VSCode to 1.70.1 and OmniSharp to 1.25.0

Expected Behavior

The OmniSharp server starts and you can use intellisense and other tools.

Actual Behavior

The OmniSharp server does not start, nothing is printed in the OUTPUT tab (as if it isn't a .NET project). If I try to select a project, or to start it manually, an error raises.

OmniSharp log

No log is generated, the server is not running

Environment information

VSCode version: 1.70.1 C# Extension: 1.25.0

Mono Information OmniSharp using built-in mono
Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.400 Commit: 7771abd614 Runtime Environment: OS Name: arch OS Version: OS Platform: Linux RID: arch-x64 Base Path: /usr/share/dotnet/sdk/6.0.400/ global.json file: Not found Host: Version: 6.0.8 Architecture: x64 Commit: 55fb7ef977 .NET SDKs installed: 3.1.408 [/usr/share/dotnet/sdk] 5.0.202 [/usr/share/dotnet/sdk] 6.0.100 [/usr/share/dotnet/sdk] 6.0.300 [/usr/share/dotnet/sdk] 6.0.400 [/usr/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 3.1.14 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.14 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Download .NET: https://aka.ms/dotnet-download Learn about .NET Runtimes and SDKs: https://aka.ms/dotnet/runtimes-sdk-info
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |better-comments|aaron-bond|3.0.2| |better-cpp-syntax|jeff-hykin|1.15.19| |cmake|twxs|0.0.17| |cmake-language-support-vscode|josetr|0.0.4| |cmake-tools|ms-vscode|1.11.26| |copilot|GitHub|1.40.6471| |cpptools|ms-vscode|1.12.1| |cpptools-extension-pack|ms-vscode|1.2.0| |cpptools-themes|ms-vscode|1.0.0| |csharp|ms-dotnettools|1.25.0| |doxdocgen|cschlosser|1.4.0| |EditorConfig|EditorConfig|0.16.4| |emulate|DiemasMichiels|1.6.0| |indent-rainbow|oderwat|8.3.1| |language-x86-64-assembly|13xforever|3.0.0| |lilypond-formatter|lhl2617|0.2.3| |lilypond-pdf-preview|lhl2617|0.2.8| |lilypond-snippets|lhl2617|0.1.1| |lilypond-syntax|jeandeaual|0.1.1| |makefile-tools|ms-vscode|0.5.0| |python|ms-python|2022.12.0| |qbs-tools|qbs-community|1.0.6| |scheme|jeandeaual|0.2.0| |theme-monokai-pro-vscode|monokai|1.1.20| |vscode-dotnet-runtime|ms-dotnettools|1.5.0| |vscode-eslint|dbaeumer|2.2.6| |vscode-pull-request-github|GitHub|0.48.1| |vscode-xml|redhat|0.21.0| |vslilypond|lhl2617|1.7.3|;

NOTE

I actually managed to get it working downgrading to version 1.24.3 and adding a symlink

sudo ln -s /usr/share/dotnet/dotnet /usr/local/bin/dotnet

I'm not sure if it's a bug or if I'm missing some changelog to update my environment correctly. Thank you.

emermao commented 2 years ago

Hi @Hackjaku,

Maybe this link will help you: https://github.com/OmniSharp/omnisharp-vscode/issues/5298#issuecomment-1176437952

Hackjaku commented 2 years ago

Thank you for your reply, but sadly I already have .NET SDK 6.0.400 installed. I think there must be something else that's causing the problem. I also have SDK 3.1 and 5.0, but I can't get rid of them since I have some old code that I have to mantain. I hope that this isn't causing any issue whatsoever.

carif commented 2 years ago

I've got the same problem on Linux.

Downgrading the C# Extension to version 1.24.4 solved the issue for me. Not sure if it helps, but I'm running the project inside a vscode-dev-containers ( https://github.com/microsoft/vscode-dev-containers/tree/main/containers/dotnet ) with variant set to 6.0 for dotnet 6.

$ dotnet --version
6.0.100-rc.2.21505.57
Hackjaku commented 2 years ago

I've got the same problem on Linux.

* Version: 1.71.2

* Commit: 74b1f979648cc44d385a2286793c226e611f59e7

* Date: 2022-09-14T21:12:14.256Z

* Electron: 19.0.12

* Chromium: 102.0.5005.167

* Node.js: 16.14.2

* V8: 10.2.154.15-electron.0

* OS: Linux x64 5.15.65-1-MANJARO snap

* Sandboxed: No

* C# Extension: 1.25.0

Downgrading the C# Extension to version 1.24.4 solved the issue for me. Not sure if it helps, but I'm running the project inside a vscode-dev-containers ( https://github.com/microsoft/vscode-dev-containers/tree/main/containers/dotnet ) with variant set to 6.0 for dotnet 6.

$ dotnet --version
6.0.100-rc.2.21505.57

I upgraded to 1.25.0 today and it's working, probably the symlink I added solved the problem even for the latest version. It's only a guess since I was just giving the new version a shot. I don't remember doing anything else since the last time, but I wans't actually trying to track the issue, so I'm not 100% sure.