SofusA / roslyn-language-server

A wrapper around Roslyn language server which makes compatible with editors other than VSCode
MIT License
31 stars 4 forks source link

thread main panicked at D:\a\roslyn-language-server\roslyn-language-server\src\roslyn.rs:47:10: #40

Open soitchy opened 2 weeks ago

soitchy commented 2 weeks ago

Running on Windows. I'm probably just being dumb here.

When starting via command 'roslyn-language-server' I receive this error:

panicked at D:\a\roslyn-language-server\roslyn-language-server\src\roslyn.rs:47:10: Unable to install Roslyn: Path "C:\Users...\AppData\Local\Temp\roslyn\out\microsoft.codeanalysis.languageserver.neutral\4.13.0-1.24477.7\content\LanguageServer\neutral" does not exist.

I manually checked the location and it indeed does not exist on my system. I must be missing some prerequisite?

SofusA commented 2 weeks ago

Sounds like a bug 😊

Does the Temp/roslyn directory exist?

soitchy commented 2 weeks ago

The temporary directory it’s looking for does not exist on my system.

SofusA commented 2 weeks ago

I can reproduce in a vm, but AppData\Local\Temp\roslyn does exist, but not the build output. I can fix this by running the dotnet command manually in this temp directory.

I will try to set up a windows development environment and see what i can do.

soitchy commented 2 weeks ago

Thanks for taking the time to look into this!

By dotnet command do you mean dotnet add package Microsoft.CodeAnalysis --version 4.11.0?

https://www.nuget.org/packages/Microsoft.CodeAnalysis/

SofusA commented 2 weeks ago

Yes exactly.

The flow of downloading the DLL is:

  1. Generate a csharp project
  2. Run add package command
  3. Move the DLL to app data directory

My guess is that step 2. is silently failing on windows because of locked files.

SofusA commented 2 weeks ago

I was actually not able to reproduce this on my windows 10 vm.

Could you please try again with the latest release?

It could be it has already been fixed

soitchy commented 2 weeks ago

On the latest release I still receive the same error.

Does the .exe need to be in any place in particular? Currently I just have it sitting in it's own folder with a PATH entry to its location.

soitchy commented 2 weeks ago

Ah so it looks like the csproj that's generated requires SDK .NET 8 and above, whereas I am currently on SDK .NET 5. Is it possible to generate a csproj that targets .NET 5 or does Roslyn require .Net 8 and above?

The error that I get when maunally adding the CodeAnalysis package via the command above is:

C:\Program Files\dotnet\sdk\5.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 8.0. [C:\Users\...\AppData\Local\Temp\roslyn\ServerDownload.csproj]

Installing .NET SDK 8 resolves the problem, but I'm still curious if we can target different frameworks?

SofusA commented 2 weeks ago

That makes sense. It would have been nice with a better error message. This is a general problem with the codebase πŸ˜„

Do you mind changing targetframework to net5.0 and try again?