C#C
C#6mo ago
elisoli

[SOLVED] C# language server on Linux

I'm trying to setup a C# development environment on my new KISS Linux system (which uses musl) and I've been failing miserably. This is what I did so far:

This was enough to create/compile/run projects. But as I use NeoVIM I need an LSP server, csharp-ls (0.12.0) for .NET 8 doesn't switch loglevels so it's very annoying to open NeoVIM and see an info message every time; Someone on Reddit told me to try roslyn.nvim, so I configured just like this:

-- Within Lazy.nvim
{
    'seblyng/roslyn.nvim',
    ft = 'cs',
    opts = {}
}


And as the documentation says I need to download the language server so I went to https://dev.azure.com/azure-public/vside/_artifacts/feed/vs-impl, searched for Microsoft.CodeAnalysis.LanguageServer and downloaded the most recent version, renamed it to .zip and extracted into ~/csharp-ls. Then I added this to NeoVIM:

vim.lsp.config('roslyn', {
    cmd = {
        'dotnet',
        '~/csharp-ls/content/LanguageServer/alpine-x64/Microsoft.CodeAnalysis.LanguageServer.dll',
        '--logLevel=Information',
        '--extensionLogDirectory=' .. vim.fs.dirname(vim.lsp.get_log_path()),
        -- '--stdio' -- Flag does not exist on this version
    }
})


After all this it doesn't work.
I open NeoVIM and it shows nothing. No information, no error, no warning, nothing.
Maybe I also need a Microsoft.CodeAnalysis.LanguageServer version that works on .NET 8?
Maybe I can run .NET 8 projects with .NET 9 and I just don't know how? Where's backwards compatibility?

I'm sorry If I'm way too stupid, but was supposed to be an easy task.
Was this page helpful?