-
Notifications
You must be signed in to change notification settings - Fork 700
The .NET Core SDK cannot be located when it's installed as a snap with dotnet-sdk. #3502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@NatoBoram Are you saying that This extension heavily depends on |
The two user-workarounds I found were to add |
Thanks. I talked to the .NET team and apparently this is expected. More information is in the .NET Core SDK release notes: https://github.com/dotnet/core/blob/master/release-notes/3.1/3.1.0/3.1.0-install-instructions.md#install-using-snap In #3507 I am hoping to add some troubleshooting instructions for when this extension cannot locate the .NET SDK, and this seems like a good thing to mention there. |
please also note this issue https://github.com/dotnet/cli/issues/12110 which should also help address the problems with snap |
After trying
The
|
You are now outside of my area of knowledge, but I believe that is the problem that Filip was referencing. There is one work around in the issue he referenced. Apparently another possible work around is -- to add the following to {
"MSBuild": {
"UseLegacySdkResolver": true
}
} |
None of these fixes did the trick for me. I guess I won't develop C# on Ubuntu. |
@sberney Since there is obviously a lot of extra configuration required to get a working install with Snap. It may be simpler to use APT instead. https://docs.microsoft.com/en-us/dotnet/core/install/linux#ubuntu & https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu |
Thanks; I'll try this next week. I thought this was the first thing I tried though. I never use snap unless there is no other way. It probably told me to use snap, or said "no such package" or something like that. |
Ubuntu 18.04: Finally my problem solved! Snap didn't work for me either. |
Hi, i am having the same problem, where do i write your solution? Excuse me if this is a very basic/noob question i just got into c# and coding. |
Issue Description
The .NET Core SDK cannot be located when it's installed as a snap
Steps to Reproduce
dotnet-sdk
Expected Behavior
The extension should work.
Actual Behavior
The extension doesn't work.
Logs
OmniSharp log
Starting OmniSharp server at 2020-01-10, 11:31:19 a.m.
Target: /home/gendnat/Code/bitbucket.org/groupecmi/gri-ms-vacation/Vacation.sln
OmniSharp server started.
Path: /home/gendnat/.vscode-insiders/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/run
PID: 17803
Starting OmniSharp on ubuntu 19.10 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.3 - "/home/gendnat/.vscode-insiders/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/gendnat/.vscode-insiders/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.3 - "/home/gendnat/.vscode-insiders/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /home/gendnat/.vscode-insiders/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin
CscToolPath = /home/gendnat/.vscode-insiders/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /home/gendnat/.vscode-insiders/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/gendnat/Code/bitbucket.org/groupecmi/gri-ms-vacation'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
Detecting projects in '/home/gendnat/Code/bitbucket.org/groupecmi/gri-ms-vacation/Vacation.sln'.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/gendnat/Code/bitbucket.org/groupecmi/gri-ms-vacation/Vacation/Vacation.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/gendnat/Code/bitbucket.org/groupecmi/gri-ms-vacation'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/gendnat/Code/bitbucket.org/groupecmi/gri-ms-vacation/Vacation/Vacation.csproj
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/gendnat/Code/bitbucket.org/groupecmi/gri-ms-vacation' on host 17658.
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/home/gendnat/Code/bitbucket.org/groupecmi/gri-ms-vacation/Vacation/Vacation.csproj'.
/home/gendnat/Code/bitbucket.org/groupecmi/gri-ms-vacation/Vacation/Vacation.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found. /home/gendnat/Code/bitbucket.org/groupecmi/gri-ms-vacation/Vacation/Vacation.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in :0
at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1] (System.Boolean condition, System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00003] in :0
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in :0
at Microsoft.Build.Evaluation.Evaluator
4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.Collections.Generic.List
1[Microsoft.Build.Construction.ProjectRootElement]& projects, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult, System.Boolean throwOnFileNotExistsError) [0x00254] in :0at Microsoft.Build.Evaluation.Evaluator
4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult) [0x00027] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 at Microsoft.Build.Evaluation.Evaluator
4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0000d] in :0at Microsoft.Build.Evaluation.Evaluator
4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000e6] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 at Microsoft.Build.Evaluation.Evaluator
4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x0011c] in :0at Microsoft.Build.Evaluation.Evaluator
4[P,I,M,D].Evaluate (Microsoft.Build.Evaluation.IEvaluatorData
4[P,I,M,D] data, Microsoft.Build.Construction.ProjectRootElement root, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, System.Int32 maxNodeCount, Microsoft.Build.Collections.PropertyDictionary1[T] environmentProperties, Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Evaluation.IItemFactory
2[S,T] itemFactory, Microsoft.Build.Evaluation.IToolsetProvider toolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCache projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService sdkResolverService, System.Int32 submissionId, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext, System.Boolean interactive) [0x0002f] in :0at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x0005e] in :0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00035] in :0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00000] in :0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00007] in :0
at Microsoft.Build.Evaluation.Project.Initialize (System.Collections.Generic.IDictionary
2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00126] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary
2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00093] in :0at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary
2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary
2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in :0at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary
2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary
2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f7] in :0at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in :0
at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath) [0x0003f] in <1e840ade9fdb41e3ae5c236a4f4a1c58>:0
at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath) [0x0000d] in <1e840ade9fdb41e3ae5c236a4f4a1c58>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectIdInfo projectIdInfo, OmniSharp.MSBuild.ProjectLoader loader) [0x00015] in <1e840ade9fdb41e3ae5c236a4f4a1c58>:0
at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass29_0.b__0 () [0x00000] in <1e840ade9fdb41e3ae5c236a4f4a1c58>:0
at (wrapper delegate-invoke) System.Func
1[System.ValueTuple
3[OmniSharp.MSBuild.ProjectFile.ProjectFileInfo,System.Collections.Immutable.ImmutableArray1[OmniSharp.MSBuild.Logging.MSBuildDiagnostic],OmniSharp.MSBuild.Notification.ProjectLoadedEventArgs]].invoke_TResult() at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject (System.String projectFilePath, System.Func
1[TResult] loader) [0x0001b] in <1e840ade9fdb41e3ae5c236a4f4a1c58>:0Attempted to update project that is not loaded: /home/gendnat/Code/bitbucket.org/groupecmi/gri-ms-vacation/Vacation/Vacation.csproj
C# log
Failed to spawn 'dotnet --info'
Environment information
VSCode version: 1.42.0-insider
C# Extension: 1.21.9
Mono Information
OmniSharp using built-in monoDotnet Information
A valid dotnet installation could not be found.Visual Studio Code Extensions
Now that all those tools aren't able to output
dotnet --info
, let me just print that command real quick.Part of the problem is that
dotnet-sdk
will expose the command asdotnet-sdk.dotnet
instead ofdotnet
./snap/dotnet-sdk/current/
can be added to$PATH
as a workaround, but then you lose auto-completion, so it's not a valid solution.The text was updated successfully, but these errors were encountered: