Skip to content
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

Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found. #4099

Closed
dsimanis opened this issue Oct 5, 2020 · 9 comments
Labels
Needs More Info .Net sdk not found These are a group of issues when the dotnet sdk could not be found

Comments

@dsimanis
Copy link

dsimanis commented Oct 5, 2020

Environment data

dotnet --info output:
.NET Core SDK (reflecting any global.json):
Version: 3.1.402
Commit: 9b5de826fd

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.402/

Host (useful for support):
Version: 3.1.8
Commit: 9c1330dedd

.NET Core SDKs installed:
3.1.402 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
VS Code version: 1.49.3
C# Extension version: 1.23.2

OmniSharp log

Starting OmniSharp server at 10/5/2020, 12:04:22 PM
Target: /Users/DSimanis/dev/freedom/digital-services/digital-services.sln

OmniSharp server started.
Path: /Users/DSimanis/.vscode/extensions/ms-dotnettools.csharp-1.23.2/.omnisharp/1.37.1/run
PID: 49082

Starting OmniSharp on MacOS 10.15.7 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.8.0 - "/Users/DSimanis/.vscode/extensions/ms-dotnettools.csharp-1.23.2/.omnisharp/1.37.1/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/Users/DSimanis/.vscode/extensions/ms-dotnettools.csharp-1.23.2/.omnisharp/1.37.1/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.8.0 - "/Users/DSimanis/.vscode/extensions/ms-dotnettools.csharp-1.23.2/.omnisharp/1.37.1/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /Users/DSimanis/.vscode/extensions/ms-dotnettools.csharp-1.23.2/.omnisharp/1.37.1/omnisharp/.msbuild/Current/Bin
CscToolPath = /Users/DSimanis/.vscode/extensions/ms-dotnettools.csharp-1.23.2/.omnisharp/1.37.1/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /Users/DSimanis/.vscode/extensions/ms-dotnettools.csharp-1.23.2/.omnisharp/1.37.1/omnisharp/.msbuild
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/DSimanis/dev/freedom/digital-services'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
Detecting projects in '/Users/DSimanis/dev/freedom/digital-services/digital-services.sln'.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/DSimanis/dev/freedom/digital-services/src/DigitalServices.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/DSimanis/dev/freedom/digital-services/test/DigitalServicesTests.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/Users/DSimanis/dev/freedom/digital-services'.
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: /Users/DSimanis/dev/freedom/digital-services/src/DigitalServices.csproj
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
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.ImplementTypeWorkspaceOptionsProvider, Order: 110
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/Users/DSimanis/dev/freedom/digital-services' on host 47880.
It was not possible to find any installed .NET SDKs.
Install a .NET SDK from:
https://aka.ms/dotnet-download
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/Users/DSimanis/dev/freedom/digital-services/src/DigitalServices.csproj'.
/Users/DSimanis/dev/freedom/digital-services/src/DigitalServices.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found. /Users/DSimanis/dev/freedom/digital-services/src/DigitalServices.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in <4322d44f99c84aab9075efd37869f964>: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 <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.Collections.Generic.List1[Microsoft.Build.Construction.ProjectRootElement]& projects, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult, System.Boolean throwOnFileNotExistsError) [0x00309] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult) [0x00027] in <4322d44f99c84aab9075efd37869f964>:0 at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0000d] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000e6] in <4322d44f99c84aab9075efd37869f964>:0 at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].Evaluate () [0x0013c] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].Evaluate (Microsoft.Build.Evaluation.IEvaluatorData4[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.IItemFactory2[S,T] itemFactory, Microsoft.Build.Evaluation.IToolsetProvider toolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCacheBase projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService sdkResolverService, System.Int32 submissionId, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext, System.Boolean interactive) [0x00047] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project+ProjectImpl.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00063] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project+ProjectImpl.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00035] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project+ProjectImpl.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00000] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project+ProjectImpl.ReevaluateIfNecessary (Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00007] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project+ProjectImpl.Initialize (System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00127] in <4322d44f99c84aab9075efd37869f964>:0 at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary2[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) [0x00073] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <4322d44f99c84aab9075efd37869f964>:0 at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <4322d44f99c84aab9075efd37869f964>:0 at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f7] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <4322d44f99c84aab9075efd37869f964>:0
at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath, System.Collections.Generic.IReadOnlyDictionary2[TKey,TValue] projectConfigurationsInSolution) [0x00160] in <7e6cb753aca94549b693616e0e7d1016>:0 at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath, System.Collections.Generic.IReadOnlyDictionary2[TKey,TValue] configurationsInSolution) [0x0000d] in <7e6cb753aca94549b693616e0e7d1016>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectIdInfo projectIdInfo, OmniSharp.MSBuild.ProjectLoader loader, System.Guid sessionId, OmniSharp.Services.DotNetInfo dotNetInfo) [0x00023] in <7e6cb753aca94549b693616e0e7d1016>:0
at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass31_0.b__0 () [0x00000] in <7e6cb753aca94549b693616e0e7d1016>:0
at (wrapper delegate-invoke) System.Func1[System.ValueTuple3[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.Func1[TResult] loader) [0x0001b] in <7e6cb753aca94549b693616e0e7d1016>:0

Loading project: /Users/DSimanis/dev/freedom/digital-services/test/DigitalServicesTests.csproj
It was not possible to find any installed .NET SDKs.
Install a .NET SDK from:
https://aka.ms/dotnet-download
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/Users/DSimanis/dev/freedom/digital-services/test/DigitalServicesTests.csproj'.
/Users/DSimanis/dev/freedom/digital-services/test/DigitalServicesTests.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found. /Users/DSimanis/dev/freedom/digital-services/test/DigitalServicesTests.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in <4322d44f99c84aab9075efd37869f964>: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 <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.Collections.Generic.List1[Microsoft.Build.Construction.ProjectRootElement]& projects, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult, System.Boolean throwOnFileNotExistsError) [0x00309] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult) [0x00027] in <4322d44f99c84aab9075efd37869f964>:0 at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0000d] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000e6] in <4322d44f99c84aab9075efd37869f964>:0 at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].Evaluate () [0x0013c] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].Evaluate (Microsoft.Build.Evaluation.IEvaluatorData4[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.IItemFactory2[S,T] itemFactory, Microsoft.Build.Evaluation.IToolsetProvider toolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCacheBase projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService sdkResolverService, System.Int32 submissionId, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext, System.Boolean interactive) [0x00047] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project+ProjectImpl.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00063] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project+ProjectImpl.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00035] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project+ProjectImpl.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00000] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project+ProjectImpl.ReevaluateIfNecessary (Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00007] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project+ProjectImpl.Initialize (System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00127] in <4322d44f99c84aab9075efd37869f964>:0 at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary2[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) [0x00073] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <4322d44f99c84aab9075efd37869f964>:0 at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <4322d44f99c84aab9075efd37869f964>:0 at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f7] in <4322d44f99c84aab9075efd37869f964>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <4322d44f99c84aab9075efd37869f964>:0
at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath, System.Collections.Generic.IReadOnlyDictionary2[TKey,TValue] projectConfigurationsInSolution) [0x00160] in <7e6cb753aca94549b693616e0e7d1016>:0 at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath, System.Collections.Generic.IReadOnlyDictionary2[TKey,TValue] configurationsInSolution) [0x0000d] in <7e6cb753aca94549b693616e0e7d1016>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectIdInfo projectIdInfo, OmniSharp.MSBuild.ProjectLoader loader, System.Guid sessionId, OmniSharp.Services.DotNetInfo dotNetInfo) [0x00023] in <7e6cb753aca94549b693616e0e7d1016>:0
at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass31_0.b__0 () [0x00000] in <7e6cb753aca94549b693616e0e7d1016>:0
at (wrapper delegate-invoke) System.Func1[System.ValueTuple3[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.Func1[TResult] loader) [0x0001b] in <7e6cb753aca94549b693616e0e7d1016>:0

Attempted to update project that is not loaded: /Users/DSimanis/dev/freedom/digital-services/src/DigitalServices.csproj
fail: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /Users/DSimanis/dev/freedom/digital-services/test/DigitalServicesTests.csproj

Steps to reproduce

  1. Open existing .NET Core 3.1 project
  2. Observe the error in OmniSharp log.

Expected behavior

.NET Core SDKs are found at the following path:
~ ᐅ ls -la /usr/local/share/dotnet/sdk/3.1.402/Sdks/
total 0
drwxr-xr-x 13 root wheel 416 25 Aug 18:47 .
drwxr-xr-x 143 root wheel 4576 5 Oct 10:33 ..
drwxr-xr-x 3 root wheel 96 25 Aug 18:47 FSharp.NET.Sdk
drwxr-xr-x 5 root wheel 160 25 Aug 18:47 ILLink.Tasks
drwxr-xr-x 3 root wheel 96 25 Aug 18:47 Microsoft.Docker.Sdk
drwxr-xr-x 6 root wheel 192 5 Oct 10:33 Microsoft.NET.Sdk
drwxr-xr-x 6 root wheel 192 5 Oct 10:33 Microsoft.NET.Sdk.Publish
drwxr-xr-x 10 root wheel 320 5 Oct 10:33 Microsoft.NET.Sdk.Razor
drwxr-xr-x 5 root wheel 160 5 Oct 10:33 Microsoft.NET.Sdk.Web
drwxr-xr-x 5 root wheel 160 5 Oct 10:33 Microsoft.NET.Sdk.Web.ProjectSystem
drwxr-xr-x 10 root wheel 320 5 Oct 10:33 Microsoft.NET.Sdk.WindowsDesktop
drwxr-xr-x 5 root wheel 160 5 Oct 10:33 Microsoft.NET.Sdk.Worker
drwxr-xr-x 6 root wheel 192 25 Aug 18:47 NuGet.Build.Tasks.Pack

Actual behavior

Following error is displayed:
info: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/DSimanis/dev/freedom/digital-services/test/DigitalServicesTests.csproj
It was not possible to find any installed .NET SDKs.
Install a .NET SDK from:
https://aka.ms/dotnet-download

@marvac
Copy link

marvac commented Oct 5, 2020

Just spent 2 hours this morning working through this issue, although I'm on Windows 10 and trying to target core 5.0 (preview).
Since I already had visual studio installed on this PC, I had to download the newest (preview) version of visual studio, then install the .NET 5 runtime. You can also automatically have it all downloaded if you select and install the ASP.NET and web development workload. Once that happened, a new entry was added:

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 3 MSBuild instance(s)
            1: Visual Studio Enterprise 2019 16.8.30524.135 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin"
            2: Visual Studio Enterprise 2019 16.7.30523.141 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
            3: StandAlone 16.8.0 - "c:\Users\Username\.vscode\extensions\ms-dotnettools.csharp-1.23.2\.omnisharp\1.37.1\.msbuild\Current\Bin"

The first entry in that list was not previously present, but now it is and it works just fine. Since you are targeting core 3.1, you may need to find a similar solution. I would assume that if you have Visual Studio installed, you would need to install the web development package through the VS installer.

@dsimanis
Copy link
Author

dsimanis commented Oct 5, 2020

@marvac That's an interesting finding. I understand that under the first entry you have a newer version of MSBuild. The one I have is under the third entry which comes along with OmniSharp. I need to make MSBuild to work with VSCode. That's why your workaround cannot be applied as is in my case.
Looks like I need to either switch to Visual Studio which will have a newer MSBuild or else find another way to install a standalone MSBuild. In the latter case, that's the whole purpose of OmniSharp plugin.

@marvac
Copy link

marvac commented Oct 5, 2020

One thing you can try is going into VSCode and searching for settings.json (I think it's command + p on a mac?), then change omnisharp.path to "omnisharp.path": "latest"

@dsimanis
Copy link
Author

dsimanis commented Oct 5, 2020

@marvac Thanks for trying. Changing the setting to "omnisharp.path": "latest" indeed downloaded the latest version of OmniSharp .omnisharp/1.37.2-beta.73, but the original error is still displayed after OmniSharp starts.

@JoeRobich
Copy link
Member

@dsimanis Just a few questions to see if we can get at the source of this.

  1. How was the .NET SDK installed? Official Microsoft installer, brew, or other?
  2. Is '/usr/local/share/dotnet' in your path?
  3. If you open a fresh 'dotnet new webapi', does it fail this same way?

Also, be sure to remove the "omnisharp.path" setting if you do not want to receive rolling builds of omnisharp.

@JoeRobich JoeRobich added .Net sdk not found These are a group of issues when the dotnet sdk could not be found Needs More Info labels Oct 5, 2020
@dsimanis
Copy link
Author

dsimanis commented Oct 5, 2020

@JoeRobich Actually, it looks like @marvac has solved the problem after all. When you suggested to see if problem exists in the newly created webapi project, I have created a new project, closed the folder of my existing project in VSCode, and opened the new one. OmniSharp hasn't produced any errors at that point. After that I have opened a new VSCode window and opened my original project again, which hasn't produced any errors either. OmniSharp output looked like this:

Getting latest OmniSharp version information
Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done!

When I originally followed on @marvac suggestion, I have changed the settings file and reloaded the plugin when prompted, without unloading the entire project. That didn't work.

Here are the answers to your questions for the sake of consistency:

  1. Official Microsoft installer.
  2. /usr/local/share/dotnet has always been in the path.
  3. dotnet new webapi didn't fail

@dsimanis dsimanis closed this as completed Oct 6, 2020
@dsimanis
Copy link
Author

dsimanis commented Oct 6, 2020

The issue is back after restarting VSCode. I have reinstalled .NET Runtime and SDKs and also OmniSharp. It produces the same errors even for the small new project created by dotnet new webapi. It looks like the issue is intermittent and cannot be reproduced every single time.

@dsimanis dsimanis reopened this Oct 6, 2020
@Micha-Richter
Copy link

Occurs only once after a restart/boot of my Mac.
Every start of VSCode afterwards doesn't throw the error - until next reboot.. 🤷‍♂️

@dsimanis
Copy link
Author

OmniSharp 1.23.3 fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info .Net sdk not found These are a group of issues when the dotnet sdk could not be found
Projects
None yet
Development

No branches or pull requests

4 participants