microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
225 stars 10 forks source link

Failed to restore solution #410

Open Noliray opened 1 year ago

Noliray commented 1 year ago

Type: Bug

if i try to open a new script in unity, and so opening visual studio, i got the notification/ error of : " failed to restore solution. Source: C# dev kit (Extension)" and cant use intellisense even with unity extention. the output i get is :

"Starting command: "dotnet.exe" restore h:\Unity\charlotte\charlotte.sln --interactive... The command could not be loaded, possibly because:

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

Learn about SDK resolution: https://aka.ms/dotnet/sdk-not-found

Failed at 'command: "dotnet.exe" restore h:\Unity\charlotte\charlotte.sln --interactive' (769ms) with error: ERROR ExitCode(2147516561) Details The command could not be loaded, possibly because:

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

Learn about SDK resolution: https://aka.ms/dotnet/sdk-not-found"

I have .net and framework downloaded , indeed i had a problem where it wouldnt find it but now its all fixed. The file it creates is in my unity project and the code in it is :"

Microsoft Visual Studio Solution File, Format Version 12.00

Visual Studio Version 17

VisualStudioVersion = 17.5.002.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{09E06A5A-65EB-41F0-9C93-9C6E723567DE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {09E06A5A-65EB-41F0-9C93-9C6E723567DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {09E06A5A-65EB-41F0-9C93-9C6E723567DE}.Debug|Any CPU.Build.0 = Debug|Any CPU {09E06A5A-65EB-41F0-9C93-9C6E723567DE}.Release|Any CPU.ActiveCfg = Release|Any CPU {09E06A5A-65EB-41F0-9C93-9C6E723567DE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5A829687-7F5E-4C28-8FBD-95E7C47EBDB1} EndGlobalSection EndGlobal"

how can i fix this problem?

Extension version: 0.3.21 VS Code version: Code 1.81.1 (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:22:42.175Z) OS version: Windows_NT x64 10.0.19045 Modes:

jbevain commented 1 year ago

It looks like the main issue is that you don't have a .NET SDK installed. It's usually being downloaded and installed for you, maybe something went wrong. Try installing a .NET SDK from:

https://aka.ms/dotnet-download

dlwiii commented 10 months ago

the install page from MS is one hot mess

github-actions[bot] commented 6 months ago

This issue has been marked as stale after 14 days of inactivity.@[@@], could you please take a look?