Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document incompatibility with MSBuildLocator #6

Closed
hochata opened this issue Apr 11, 2023 · 9 comments
Closed

Document incompatibility with MSBuildLocator #6

hochata opened this issue Apr 11, 2023 · 9 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@hochata
Copy link

hochata commented Apr 11, 2023

Describe the bug

I tried to run csharp-ls and failed with a very cryptic error. I turns out the error was caused by the ASDF shim not being the real dotnet executable.

Steps to reproduce

Details here.

Expected behavior

Code-wise there isn't anything to do. ASDF shims and the MSBuildLocator are just incompatible. But maybe this behavior could be documented here to prevent newbies like me from getting lost in the cryptic stack-traces.

@hochata hochata added the bug Something isn't working label Apr 11, 2023
@hensou
Copy link
Owner

hensou commented Apr 11, 2023

@hochata thanks for taking time to report that. I'll have a deeper look soon.

But just from a quick look at it, looks like it's something bigger than the shim thing.

dotnet/roslyn#67383
https://github.com/dotnet/runtime/blob/main/docs/design/features/native-hosting.md

@hochata
Copy link
Author

hochata commented Apr 12, 2023 via email

hensou added a commit that referenced this issue May 6, 2023
As reported on #6, some lsp can fail to detect the dotnet installation,
not sure its an error of this library or dotnet heuristics itself.
@hensou
Copy link
Owner

hensou commented May 6, 2023

@hochata, I was investigating this further, I found some interesting things:

  • I made a test with neovim (lazyvim) + omnisharp and the lsp does work.
  • With csharp-ls it does not work.
  • I it works with Ionide, as I also tested with F#.

Now I'll try to see if there is some environment variable missing that could help with this issue.

In the meantime I updated the docs as you suggested, let me know if there are more details that would be nice to have on it.

@hensou
Copy link
Owner

hensou commented May 6, 2023

It seems that the root cause is this microsoft/MSBuildLocator#210 and it seems that csharp-ls uses a version of MSBuildLocator that is >= 1.5.3

Maybe a fix would be to force the library path with the linker, as stated at dotnet/format#1785

Now the odd thing is that, if I manually run csharp-ls it does find the asdf installation.

@hensou hensou mentioned this issue May 6, 2023
hensou added a commit that referenced this issue May 6, 2023
docs: specify csharp-ls on the warning information

As reported on #6, some lsp can fail to detect the dotnet installation,
not sure its an error of this library or dotnet heuristics itself.
@hensou hensou added the help wanted Extra attention is needed label May 6, 2023
@hochata
Copy link
Author

hochata commented May 6, 2023 via email

@hochata
Copy link
Author

hochata commented May 6, 2023 via email

@hensou
Copy link
Owner

hensou commented May 6, 2023

Can you provide information on what editor you use and how you configured omnisharp? I wanted to reproduce it on my side. With csharp-ls it does fail, but omnisharp works for me

@hochata
Copy link
Author

hochata commented May 6, 2023 via email

@hochata
Copy link
Author

hochata commented May 6, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants