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.

.NET tool does not seem to find the SDK

See original GitHub issue

Hi. It may be not the best place, but here’s a problem/question. I’m trying to run fsautocomplete, a .NET tool, and getting

$ fsautocomplete 
You must install .NET to run this application.

App: /home/goose/.dotnet/tools/fsautocomplete
Architecture: x64
App host version: 7.0.0
.NET location: Not found

However, SDK exist:

$ dotnet --list-sdks
6.0.403 [/nix/store/4j4w9b1a9n54zmdrvfwhcsxgwsb3k1qq-dotnet-core-combined/sdk]
7.0.100 [/nix/store/4j4w9b1a9n54zmdrvfwhcsxgwsb3k1qq-dotnet-core-combined/sdk]

As well as runtimes:

$ dotnet --list-runtimes 
Microsoft.AspNetCore.App 6.0.11 [/nix/store/4j4w9b1a9n54zmdrvfwhcsxgwsb3k1qq-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0 [/nix/store/4j4w9b1a9n54zmdrvfwhcsxgwsb3k1qq-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.11 [/nix/store/4j4w9b1a9n54zmdrvfwhcsxgwsb3k1qq-dotnet-core-combined/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0 [/nix/store/4j4w9b1a9n54zmdrvfwhcsxgwsb3k1qq-dotnet-core-combined/shared/Microsoft.NETCore.App]

$DOTNET_ROOT is defined as well:

$ echo $DOTNET_ROOT
/nix/store/4j4w9b1a9n54zmdrvfwhcsxgwsb3k1qq-dotnet-core-combined

and points to the correct location.

Moreover, dotnet run works in a sample project. But the .net tool won’t start.

What other places or env paths do the nuget packages look for, besides $PATH and $DOTNET_ROOT?

Issue Analytics

  • State:open
  • Created 7 months ago
  • Reactions:3
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
felschrcommented, Feb 14, 2023

I do, the only thing that changed is my nixpkgs flake input. And as you can see above, dotnet --list-sdks even finds the SDK. It’s just dotnet format that fails.

1reaction
felschrcommented, Feb 14, 2023

Out of curiosity: Does dotnet format work for you? It started failing for me after I updated nix flake inputs (including .NET SDK):

No .NET SDKs were found.

Download a .NET SDK:
https://aka.ms/dotnet/download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
Unable to locate MSBuild. Ensure the .NET SDK was installed with the official installer.

With this SDK version dotnet format works fine for me:

❯ dotnet --list-sdks                                                                  
7.0.100 [/nix/store/6mwwnyxxq9j28vgnk7lknb7sgpvxfyn3-dotnet-core-combined/sdk]

And this is the version where it fails:

❯ dotnet --list-sdks      
7.0.102 [/nix/store/74942cgwzr715prs4wlqdhhd8kh75700-dotnet-core-combined/sdk]

I haven’t tried any versions in-between.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - .NET SDK's Not Installing Correctly
Run the where.exe dotnet command to see where the host is looking for ... other tools can recognize my .net 6 sdk but...
Read more >
The SDK 'Microsoft.NET.Sdk' specified could not be found. ...
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
Read more >
Unable to locate the .NET SDK: The Reasons - Hamid Mosalla
Navigate to C:\Program Files\dotnet\sdk and see if you can find folders associated with different sdk versions. If you can't find any folder ...
Read more >
Visual Studio 2019 unable to locate .Net Core SDK
I have the SDK version specified in the JSON and all the other tools specified in the tutorial, but still nada. I think...
Read more >
NET SDK tools not in path for post build commands
NET tools folder. What does work is running the Visual Studio installer (which appears to have no idea that you installed the developer...
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