razzmatazz / csharp-language-server

Roslyn-based LSP language server for C#
MIT License
536 stars 34 forks source link

Doesn't find installed sdk #66

Open tilupe opened 1 year ago

tilupe commented 1 year ago

I tried to use the c-sharp-server in neovim, but I ran into a error. So I tried to run the server just by itself and I got:


You must install or update .NET to run this application.

App: /home/USER/.local/share/nvim/mason/packages/csharp-language-server/csharp-ls Architecture: x64 Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64) .NET location: /usr/lib/dotnet

No frameworks were found.

Learn about framework resolution: https://aka.ms/dotnet/app-launch-failed

To install missing framework, download: https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=7.0.0&arch=x64&rid=pop.22.04-x64


But my I have 7.0 installed but it is at /usr/share/dotnet/sdk and not at /usr/lib/dotnet I tried adding a symlink but it wouldn't help. Then I realized I missed the runtime and installed it but I still got:


You must install .NET to run this application.

App: /home/notomoro/.local/share/nvim/mason/packages/csharp-language-server/csharp-ls Architecture: x64 App host version: 7.0.2 .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=pop.22.04-x64&apphost_version=7.0.2


I am not sure if this is a installation problem of I am using Pop-Os 22.04

dotnet --list-sdks 7.0.102 [/usr/share/dotnet/sdk]

dotnet --list-runtimes Microsoft.AspNetCore.App 7.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 7.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

I installed csharp-language-server via https://github.com/williamboman/mason.nvim

Maybe this is a package problem on my side?

tilupe commented 1 year ago

Sorry for opening the issue to fast. I could resolve it by creating the correct symlinks. I added now symlinks from /usr/lib/dotnet/shared/Microsoft.NETCore.App and Microsoft/AspNetCore.App to /ust/share/dotnet/shared/Microsoft.NETCore.App/7.0.2 and Microsoft/AspNetCore.App

Not sure if this was a mistake of my side or changes of Microsoft where they install the runtimes (it seemd 6.0 is installed still at the "correct"/"old" place.)

Feel free to close this issue if there must me nothing adapted

WhiteBlackGoose commented 1 year ago

I have a similar issue:

[ERROR][2023-02-14 09:22:38] .../vim/lsp/rpc.lua:734    "rpc"   "csharp-ls" "stderr"    "No .NET SDKs were found.\n\nDownload a .NET SDK:\nhttps://aka.ms/dotnet/download\n\nLearn about SDK resolution:\nhttps://aka.ms/dotnet/sdk-not-found\n"

csharp-ls runs from CLI normally though. And SDKs and all exist (but not in /usr/lib or anywhere in "standard locations")

Veliti commented 1 year ago

Changing DOTNET_ROOT environment variable (on pop os in /etc/profile.d/dotnet.sh) to location of dotnet helped.

lungarella-raffaele commented 3 months ago

I have a similar issue:

[ERROR][2023-02-14 09:22:38] .../vim/lsp/rpc.lua:734  "rpc"   "csharp-ls" "stderr"    "No .NET SDKs were found.\n\nDownload a .NET SDK:\nhttps://aka.ms/dotnet/download\n\nLearn about SDK resolution:\nhttps://aka.ms/dotnet/sdk-not-found\n"

csharp-ls runs from CLI normally though. And SDKs and all exist (but not in /usr/lib or anywhere in "standard locations")

I have the exact same error, did you find a solution?

Polanas commented 4 weeks ago

I also have the same error. Tried both solutions listed here, nothing helped. Did anybody find a solution?

lungarella-raffaele commented 4 weeks ago

My error resolved by doing a clean re-installation of everything. I don't know which was the problem but I advice you to do the same