Open hochata opened 1 year ago
Ok, I figured it out. It seem that to find the SDK, the MSBuildLocator follows the dotnet
symlink until it arrives to the real binary. But the dotnet
executable in my path was just a shim created by ASDF.
Because the final executable was not the real SDK, the search failed. I solved by setting adding the real dotnet
to the path.
Is there a Wiki or something where I can document this? It was pretty cryptic error.
Or maybe I should ping the mantainer for the ASDF plugin... I'm not sure.
If someone thinks this shouldn't be mentioned here, I'll just close the issue.
@hochata many thanks for the solution
@hochata thank you! I wouldn't figure it out in a million years! In my case it helped to unlink/uninstall dotnet from brew and just install it manually, so that my only path (where dotnet
) is /usr/local/share/dotnet/dotnet
My error was:
Error executing vim.schedule lua callback: ...w/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp.lua:1308: RPC[Error] code_name = InternalError, message = "System.InvalidOperationException: Failed to find a
n appropriate version of .NET Core MSBuild. Call to hostfxr_resolve_sdk2 failed. There may be more details in stderr.\
at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetDotNetBasePaths(String workingDirectory)+MoveNext()\
at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetInstances(String workingDirectory)+MoveNext()\
at Microsoft.Build.Locator.MSBuildLocator.GetInstances(VisualStudioInstanceQueryOptions options)+MoveNext()\
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()\
at Microsoft.FSharp.Collections.SeqModule.IsEmpty[T](IEnumerable`1 source) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\seq.fs:line 851\
at CSharpLanguageServer.Server.handleInitialize@196-6.Invoke(Unit _arg9) in /home/runner/work/csharp-language-server/csharp-language-server/src/CSharpLanguageServer/Server.fs:line 198\
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, b result1, FSharpFunc`2 userCode) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\async.fs:line 528\
at Ionide.LanguageServerProtocol.Server.sendServerNotification@111-3.Invoke(AsyncActivation`1 ctxt) in /_//src/LanguageServerProtocol.fs:line 111\
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\async.fs:line 112"
stack traceback:
[C]: in function 'assert'
...w/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp.lua:1308: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
I was able to fix the problem by uninstalling asdf with homebrew, deleting all of its plugin files manually and installing again; It was quite painful, but it worked.
When trying to run it, the server starts but then crashes because it can't find any SDK. I installed the dotnet SDK using ASDF with the dotnet plugin, so there is probably a misconfiguration. Both
DOTNET_ROOT
andMSBuildSDKsPath
are set.This error is probably not directly related the
csharp-ls
, as I get the same error with Omnisharp, but I don't really know where else to ask for help.This is the last message from the server.
This is the content of
stderr
This is the result of
dotnet --info
Any idea about what I could do to solve it?