Open timshannon opened 2 years ago
hi @timshannon
csharp-ls does not use mono itself, but roslyn libraries that we use are probably trying to find .net fx lib reference dlls and fail for you..
so to confirm, csharp-ls is actually running on dotnet-6 runtime -- but runtime for running csharp-ls should not be related to the actual ability to parse older projects, as was verified by @josteink, I think..
I don't think you need mono for this, but maybe, not sure if roslyn picks up mono reference dlls automatically? -- refering to @josteink for confirmation again..
btw, what is the functionality that you're missing? does autocomplete work? do you get diagnostics/errors? which editor/client are you running on?
Since I was name-dropped I'll be polite enough to answer as best as I can, but really all I did was apt install mono-complete
and nothing more than that. 🥹
The .NET Framework projects I tested with was class-libraries and console-apps originally written for Windows, but which still built and ran cleanly with mono.
For those projects csharp-ls
worked fine for me.
I'm using Vim 8 with coc.nvim. I think it's likely an issue with the Godot SDK which is what I'm trying to work with. I'm still investigating. I was more looking for confirmation that it should work with Mono, which you given me.
It's likely an issue on my side, but I'll update this issue as I look into it.
Thanks,
I have a similar issue with nvim lsp, this is a unity project with generated files on windows, I'm using WSL2 to edit the files on windows with nvim. Mono and .NET 6 is installed (in wsl). This is the first time working with C# so I have no idea what I'm doing wrong 😅
this is part of the log, sorry for the image.
my .cs
file looks like this:
The way I read those errors, it says that the mono reference-assmeblies are not installed. Could that be right?
How you get those installed in your setup, I have no idea :smile:
For me the mono assemblies / SDK are installed, just not where they are expected to be possibly?
The error references looking for them in at /usr/share/dotnet
when they are actually at /usr/lib/mono/
.
using export FrameworkPathOverride=/etc/mono/4.5
fixes my mono problem.
but i still have the error Found project reference without a matching metadata reference
, does that have something to do with this languageserver? I still have the same diagnostic errors like in the screenshot above
FWIW, I have no issues with a barbones project referencing the same framework version as my Godot project (4.7.2), so even without exporting the FrameworkPathOverride
, it seems to be finding the mono framework fine on my machine.
I think the "Godot SDK" is what it's stumbling over.
Does omnisharp fare better here? Maybe we could port over some fixes?
No idea what I did to change things, but it all appears to be working now.
Great. Now this project contains voodoo as well 😅
A hack is a hack 😂
Sorry for (somewhat) hijacking the discussion, but I have a similar issue I'm trying to resolve - I have a windows based .net FW (4.7.2) project (solution) that resides on a windows partition as usual. I'm trying to setup a WSL2 based vim configuration to code in it using using coc-nvim.
I was able the setup the coc-nvim plugin as described here https://github.com/coc-extensions/coc-omnisharp. However - while the plugin seems to find all symbols within the solution projects, the SDK symbols are unavailable (e.g. 'system', or whatever).
They are, of course available somewhere in through WSL's '/mnt/c.../ mount (in fact msbuild runs successfully from within WSL), but csharp-language-server doesn't know where to locate these symbols.
Hence the question - is there anyway to configure the server references lookup and so?
For anyone in a similar situation to me having spent the better part of like a day and a half trying to figure out what's going on with this, I think you need to use export FrameworkPathOverride=/etc/mono/4.7.1-api
or whichever version you need, then be sure to reboot. I thought I'd refreshed my environment sufficiently but after a reboot everything literally just started working so that's the best guess I've got on the issue.
I'm trying to use coc.nvim with C#, and this appears to be new only supported LSP.
I'm on linux and I have the latest Mono SDKs and .NET core 5 & 6 installed, but I'm getting this when trying to use csharp-ls:
So csharp-ls is running via .net 6, but the solution needs .net 4.7.2 which is supplied via mono. Anyone know how I work around this?