question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

csharp-ls not working with .NET SDK (7.0.100)

See original GitHub issue

I’m using archlinux and dotnet has been updating. Even if I install dotnet-sdk-6.0 (v 6.0.11) I get the following error.

"rpc" "csharp-ls" "stderr" "You must install or update .NET to run this application. 
App: /home/jlaunay/.local/share/nvim/mason/packages/csharp-language-server/csharp-ls 
Architecture: x64 
Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64) 
.NET location: /usr/share/dotnet 
The following frameworks were found: 
  7.0.0 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] 
Learn about framework resolution: 
https://aka.ms/dotnet/app-launch-failed 
To install missing framework, download: 
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.0&arch=x64&rid=arch-x64
# /usr/share/dotnet/dotnet --list-sdks
6.0.111 [/usr/share/dotnet/sdk]
7.0.100 [/usr/share/dotnet/sdk]

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
razzmatazzcommented, Dec 30, 2022

OK, I have released a new version 0.6.0 on nuget:

lets see if this fixes things for you

1reaction
razzmatazzcommented, Dec 29, 2022

ok, I’ve added more logging to what MSBuildLocator returns as possible SDK versions when registering sdk for a project and now I get this:

 :: Connected to [csharp-ls:47868/starting].
LSP :: csharp-ls: csharp-ls is released under MIT license and is not affiliated with Microsoft Corp.; see https://github.com/razzmatazz/csharp-language-server
LSP :: csharp-ls: initializing, csharp-ls version 1.0.0.0; options are: {"SolutionPath":null,"LogLevel":4}
LSP :: csharp-ls: `dotnet --version`: 7.0.101
LSP :: csharp-ls: MSBuildLocator instances found:
LSP :: csharp-ls: - SDK=".NET Core SDK", Version=6.0.401, MSBuildPath="/usr/local/share/dotnet/sdk/6.0.401", DiscoveryType=DotNetSdk
LSP :: csharp-ls: - SDK=".NET Core SDK", Version=6.0.400, MSBuildPath="/usr/local/share/dotnet/sdk/6.0.400", DiscoveryType=DotNetSdk
LSP :: csharp-ls: - SDK=".NET Core SDK", Version=6.0.301, MSBuildPath="/usr/local/share/dotnet/sdk/6.0.301", DiscoveryType=DotNetSdk
LSP :: csharp-ls: - SDK=".NET Core SDK", Version=6.0.300, MSBuildPath="/usr/local/share/dotnet/sdk/6.0.300", DiscoveryType=DotNetSdk
LSP :: csharp-ls: - SDK=".NET Core SDK", Version=6.0.202, MSBuildPath="/usr/local/share/dotnet/sdk/6.0.202", DiscoveryType=DotNetSdk
LSP :: csharp-ls: - SDK=".NET Core SDK", Version=6.0.201, MSBuildPath="/usr/local/share/dotnet/sdk/6.0.201", DiscoveryType=DotNetSdk
LSP :: csharp-ls: - SDK=".NET Core SDK", Version=6.0.200, MSBuildPath="/usr/local/share/dotnet/sdk/6.0.200", DiscoveryType=DotNetSdk
LSP :: csharp-ls: - SDK=".NET Core SDK", Version=6.0.101, MSBuildPath="/usr/local/share/dotnet/sdk/6.0.101", DiscoveryType=DotNetSdk
LSP :: csharp-ls: MSBuildLocator: will register ".NET Core SDK", Version=6.0.401 as default instance
LSP :: csharp-ls: attempting to find and load solution based on cwd ("/Users/bob/src/test-csharp-net7")..
LSP :: csharp-ls: 0 solution(s) found: []
LSP :: csharp-ls: no or multiple .sln files found on /Users/bob/src/test-csharp-net7
LSP :: csharp-ls: looking for .csproj/fsproj files on /Users/bob/src/test-csharp-net7..
LSP :: csharp-ls: loading project "/Users/bob/src/test-csharp-net7/test-csharp-net7.csproj"..
LSP :: csharp-ls: OK, 1 project files loaded
LSP :: csharp-ls:47868 initialized successfully in folders: (/Users/bob/src/test-csharp-net7)
LSP :: csharp-ls: "initialized" notification received from client

but! dotnet --list-sdks on this directory returns:

dotnet --list-sdks
dotnet --list-sdks
6.0.101 [/usr/local/share/dotnet/sdk]
6.0.200 [/usr/local/share/dotnet/sdk]
6.0.201 [/usr/local/share/dotnet/sdk]
6.0.202 [/usr/local/share/dotnet/sdk]
6.0.300 [/usr/local/share/dotnet/sdk]
6.0.301 [/usr/local/share/dotnet/sdk]
6.0.400 [/usr/local/share/dotnet/sdk]
6.0.401 [/usr/local/share/dotnet/sdk]
7.0.100 [/usr/local/share/dotnet/sdk]
7.0.101 [/usr/local/share/dotnet/sdk]

though we do have global.json at the top of the project:

{
    "sdk": {
        "version": "7.0",
        "rollForward": "minor"
    }
}

will need to investigate what it is that triggers msbuildlocator not to recognize 7.0.x sdks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot load or run lots of my projects in my solution after ...
Base Path: C:\Program Files\dotnet\sdk\7.0.100\. Host: Version: 7.0.0. Architecture: x64. Commit: d099f075e4 .NET SDKs installed:
Read more >
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
NET 7.0 Framework option is not available after installation ...
I downloaded the .NET 7.0 from here. And installed it on my Windows machine but while creating the project, I am not able...
Read more >
SDK Resolver Failure - Net 7 - Net 6
I experienced a similar problem. I uninstalled the 7.0.100-preview.5.22307.18 sdk using add remove programs and then changed the ...
Read more >
Visual Studio 2019 unable to locate .Net Core SDK
Step 1) First run dotnet --list-sdks from the command line (as in Grzegorz Smulko's answer). Take note of the greatest version number.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found