The .NET Core SDK cannot be located: A valid dotnet installation could not be found. #6177
Labels
.Net sdk not found
These are a group of issues when the dotnet sdk could not be found
Resolved-Not Reproducible
Milestone
Type: Bug
Issue Description
Even though my .NET SDK is installed perfectly.
Steps to Reproduce
Open VS Code from menu.
Expected Behavior
C# extension recognises .NET SDK and runs well.
Actual Behavior
Error popup appears.
Logs
C# log
Download a .NET SDK:
https://aka.ms/dotnet/download
Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
[Error - 11:19:33 AM] [LanguageServerHost]System.InvalidOperationException: Failed to find an 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 System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable
1 source, Boolean& found)at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable
1 source) at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LanguageServerProjectSystem.TryEnsureMSBuildLoadedAsync(String workingDirectory) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs:line 140 at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.LanguageServerProjectSystem.OpenSolutionAsync(String solutionFilePath) in /_/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs:line 78 at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem
3.StartRequestAsync(TRequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs:line 136Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime
A valid dotnet installation could not be found
C# LSP Trace Logs
Environment information
VSCode version: 1.81.1
C# Extension: 2.0.376
Using OmniSharp: false
Dotnet Information
Host:
Version: 7.0.10
Architecture: x64
Commit: a6dbb800a4
.NET SDKs installed:
No SDKs were found.
.NET runtimes installed:
Microsoft.NETCore.App 7.0.10 [/home/fuszenecker/.config/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.10/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Visual Studio Code Extensions
Extension version: 2.0.376
VS Code version: Code 1.81.1 (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:18:39.991Z)
OS version: Linux x64 6.4.10-arch1-1
Modes:
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: