Omnisharp-vscode: .NET Core 3: The SDK 'Microsoft.NET.Sdk' specified could not be found. [Ubuntu 19.04]

Created on 23 Sep 2019  Â·  22Comments  Â·  Source: OmniSharp/omnisharp-vscode

Greetings,

the extension does not appear to find the SDK anymore for the .NET Core 3 RTW version released today. With a clean installation of Ubuntu 19.04, attempting to open a newly created dotnet new console project throws an The SDK 'Microsoft.NET.Sdk' specified could not be found. error in the OmniSharp console.

Full OmniSharp log on debug level:

Starting OmniSharp server at 9/23/2019, 11:08:01 PM
    Target: /home/zeroskyx/Downloads/Test

OmniSharp server started.
    Path: /home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/run
    PID: 8180

[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Cake, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.DotNetTest, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Host, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.MSBuild, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Roslyn, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Roslyn.CSharp, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Script, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Shared, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on ubuntu 19.4 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[dbug]: OmniSharp.MSBuild.Discovery.Providers.MonoInstanceProvider
        Could not retrieve Mono runtime path
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 16.0 - "/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin"
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        SUCCESS: Resolved to '/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Utilities.Core.dll' (name-only).
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        SUCCESS: Resolved to '/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Tasks.Core.dll' (name-only).
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        SUCCESS: Resolved to '/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Framework.dll' (name-only).
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        SUCCESS: Resolved to '/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.Build.dll' (name-only).
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 16.0 - "/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin"
            MSBuildExtensionsPath = /home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild
            BypassFrameworkInstallChecks = true
            CscToolPath = /home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = /home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.VisualBasic.Workspaces, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.VisualBasic.Features, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.VisualBasic.Features.dll'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/home/zeroskyx/Downloads/Test'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[dbug]: OmniSharp.MSBuild.ProjectSystem
        MSBuild environment: 
Mode: Standalone
RunningTests: False
RunningInVisualStudio: False
MSBuildToolsDirectory32: /home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin
MSBuildToolsDirectory64: /home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin
MSBuildSDKsPath: /home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Sdks
CurrentMSBuildConfigurationFile: /home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/MSBuild.dll.config
CurrentMSBuildExePath: /home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/MSBuild.dll
CurrentMSBuildToolsDirectory: /home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin
VisualStudioInstallRootDirectory: 
MSBuildExtensionsPath: /home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin

[dbug]: OmniSharp.MSBuild.ProjectLoader
        'MSBuildExtensionsPath' set to '/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild'
[dbug]: OmniSharp.MSBuild.ProjectLoader
        'CscToolPath' set to '/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Roslyn'
[dbug]: OmniSharp.MSBuild.ProjectLoader
        'CscToolExe' set to 'csc.exe'
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in '/home/zeroskyx/Downloads/Test'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/zeroskyx/Downloads/Test/Test.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/home/zeroskyx/Downloads/Test'.
[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/zeroskyx/Downloads/Test/Test.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/zeroskyx/Downloads/Test' on host 8069.
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 2,
  "Command": "/projects"
}
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 1,
  "Command": "/projects"
}
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 3,
  "Command": "/filesChanged",
  "Arguments": [
    {
      "FileName": "/home/zeroskyx/.config/Code/logs/20190923T230759/sharedprocess.log",
      "changeType": "Create"
    }
  ]
}
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 4,
  "Command": "/filesChanged",
  "Arguments": [
    {
      "FileName": "/home/zeroskyx/.config/Code/logs/20190923T230759/telemetry.log",
      "changeType": "Create"
    }
  ]
}
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 3,
  "Command": "/filesChanged",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {},
  "Seq": 46,
  "Type": "response"
}
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 4,
  "Command": "/filesChanged",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {},
  "Seq": 47,
  "Type": "response"
}
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.Build.resources, Version=15.1.0.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.Build.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.DotNet.MSBuildSdkResolver.resources, Version=2.2.202.0, Culture=en-US, PublicKeyToken=adb9793829ddae60'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.DotNet.MSBuildSdkResolver.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.DotNet.MSBuildSdkResolver.resources, Version=2.2.202.0, Culture=en, PublicKeyToken=adb9793829ddae60'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/home/zeroskyx/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.DotNet.MSBuildSdkResolver.resources.dll'.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file '/home/zeroskyx/Downloads/Test/Test.csproj'.
/home/zeroskyx/Downloads/Test/Test.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found.  /home/zeroskyx/Downloads/Test/Test.csproj
  at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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 <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 
  at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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) [0x0024e] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 
  at 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 <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0000d] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000e6] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x00103] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 
  at 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.PropertyDictionary`1[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) [0x0002d] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 
  at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x0005e] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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 <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 
  at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00000] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 
  at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00007] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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 <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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 <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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) [0x00000] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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 <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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) [0x00000] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 
  at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f7] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 
  at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 
  at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath) [0x0003f] in <66e377b85a4d44b3a9b82d0e2eafa257>:0 
  at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath) [0x0000d] in <66e377b85a4d44b3a9b82d0e2eafa257>:0 
  at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectIdInfo projectIdInfo, OmniSharp.MSBuild.ProjectLoader loader) [0x00015] in <66e377b85a4d44b3a9b82d0e2eafa257>:0 
  at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass29_0.<LoadProject>b__0 () [0x00000] in <66e377b85a4d44b3a9b82d0e2eafa257>:0 
  at (wrapper delegate-invoke) System.Func`1[System.ValueTuple`3[OmniSharp.MSBuild.ProjectFile.ProjectFileInfo,System.Collections.Immutable.ImmutableArray`1[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 <66e377b85a4d44b3a9b82d0e2eafa257>:0 

[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: /home/zeroskyx/Downloads/Test/Test.csproj
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 1,
  "Command": "/projects",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "MsBuild": {
      "SolutionPath": "/home/zeroskyx/Downloads/Test",
      "Projects": []
    },
    "Script": {
      "Projects": []
    }
  },
  "Seq": 43,
  "Type": "response"
}
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 2,
  "Command": "/projects",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "MsBuild": {
      "SolutionPath": "/home/zeroskyx/Downloads/Test",
      "Projects": []
    },
    "Script": {
      "Projects": []
    }
  },
  "Seq": 42,
  "Type": "response"
}
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 5,
  "Command": "/projects"
}
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 5,
  "Command": "/projects",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "MsBuild": {
      "SolutionPath": "/home/zeroskyx/Downloads/Test",
      "Projects": []
    },
    "Script": {
      "Projects": []
    }
  },
  "Seq": 62,
  "Type": "response"
}

Environment information:

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100
 Commit:    04339c3a26

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  19.04
 OS Platform: Linux
 RID:         ubuntu.19.04-x64
 Base Path:   /usr/share/dotnet/sdk/3.0.100/

Host (useful for support):
  Version: 3.0.0
  Commit:  95a0a61858

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

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

Help is greatly appreciated -- keep up the great work guys!

Best regards
-Simon

Most helpful comment

my omnisharp.json file :

{
    "MSBuild": {
        "UseLegacySdkResolver": true
    }
 }

and my global.json (optional, check your sdk version by "dotnet --list-sdks")

{
    "sdk": {
      "version": "3.0.100"
    }
}

https://github.com/larryw3i/POYA/tree/NETCore3.0/POYA
It works properly.

All 22 comments

Same issue in Windows 10.
Just create new console app by dotnet new console, and got the same issue.


[FIXED]
Fixed by updated to latest VS 2019.

On a side note: when I downgrade to 2.2 it works flawlessly.

The following workaround appears to fix the SDK resolution:

Update your omnisharp.json to contain the following:

{
    "MSBuild":
    {
        "UseLegacySdkResolver": true
    }
}

@zeroskyx , try to install Mono 6.0.0. FYI #3289

I've just updated to .net core 3. Loaded VSCode. Update for Omnisharp. Now can't build with the same error. Im on a mac.

I believe this is due to Omnisharp, not shipping with the correct version of MSBuild for .Net Core 3. Omnisharp ships with MSBuild 15. Dotnet Core 3 uses version 16. If you can install vs2019, that will install msbuild version 16, and everything should work as expected.

This is why downgrading to 2.2 works fine. 2.2 uses msbuild 15.

Unfortunately vs 2019 isnt available on Linux, so this workaround does not work for Linux. I am not sure if there is another way to update, but I suspect we will be stuck waiting for omnisharp to update its msbuild version

[FIXED]
Fixed by updated to latest VS 2019.

Does it mean that I MUST have VS 2019 installed?

Hi @mniak, you can try this -> 3289#issuecomment-534488147

@seanmars I actuallyt have Visual Studio and after the 16.3.0 update the plugin worked properly.
I just wanted to know if Visual Studio was a requirement. Thanks for your reponse, it makes me know that you need at least the build tools for VS 2019

Same issue in Ubuntu 18。04
Just create new console app by dotnet new console, and got the same issue.
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found. /home/moon/Project/NetCore/Gadgets/ciphertool/ciphertool.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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 <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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) [0x0024e] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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 <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0000d] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000e6] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x00103] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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.ProjectRootElementCache projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService sdkResolverService, System.Int32 submissionId, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x0002d] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x0005e] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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 <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00000] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00007] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.Evaluation.Project.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) [0x00126] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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) [0x00093] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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 <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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 <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>: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 <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0 at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f7] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath) [0x0003f] in :0
at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath) [0x0000d] in :0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectIdInfo projectIdInfo, OmniSharp.MSBuild.ProjectLoader loader) [0x00015] in :0
at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass29_0.b__0 () [0x00000] in :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 :0

.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26

Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/3.0.100/

Host (useful for support):
Version: 3.0.0
Commit: 95a0a61858

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

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

my omnisharp.json file :

{
    "MSBuild": {
        "UseLegacySdkResolver": true
    }
 }

and my global.json (optional, check your sdk version by "dotnet --list-sdks")

{
    "sdk": {
      "version": "3.0.100"
    }
}

https://github.com/larryw3i/POYA/tree/NETCore3.0/POYA
It works properly.

THX @larryw3i! The key is the omnisharp.json. Now it works for me on ubuntu 19.04 with 3.0.100 sdk.

I believe this is due to Omnisharp, not shipping with the correct version of MSBuild for .Net Core 3. Omnisharp ships with MSBuild 15. Dotnet Core 3 uses version 16. If you can install vs2019, that will install msbuild version 16, and everything should work as expected.

This is why downgrading to 2.2 works fine. 2.2 uses msbuild 15.

Unfortunately vs 2019 isnt available on Linux, so this workaround does not work for Linux. I am not sure if there is another way to update, but I suspect we will be stuck waiting for omnisharp to update its msbuild version

This _still_ is not fixed. How did they not think about this with the rollout of .NET Core 3.0?

Same issue... so where do I create the omnisharp.json file?

found it is ~/.omnisharp/omnisharp.json

per @larryw3i creating this file with content below fixes the issue for me.

{
    "MSBuild": {
        "UseLegacySdkResolver": true
    }
 }

This should be fixed in the latest OmniSharp build. To try it, add the following to your VS Code settings and restart VS Code:

    "omnisharp.path": "1.34.4-beta.34"

This will download the latest prerelease OmniSharp to your VS Code. Thanks.

This issue is really a duplicate of #3290
The difference is that the problem from "this" issue you'd experience when you only have .NET Core 3.0 SDK installed (no other ones) whereas the problem from "that" issue you'd experience when you have 3.0 SDK installed + other SDKs installed too (i.e. 2.2).

Either way, this should be fixed in the latest Omnisharp 1.34.4.

Extension 1.21.4 with OmniSharp 1.34.4 and the fix above has been released - please update 😀
also, if you used a custom OmniSharp version via "omnisharp.path": .... setting I recommend you now remove it - as you'd be stuck on an old build.

Works like a charm -- thank you for the quick fix :)

This _still_ is not fixed. How did they not think about this with the rollout of .NET Core 3.0?

OmniSharp has been planning and preparing for .NET Core 3.0 for months. We have been shipping with MsBuild 16 since April and supported all preview releases of .NET Core 3.0. However, at the last moment - between last preview and .NET Core 3.0 RTM, the .NET Core team raised the minimum MSBuild version from 16.0 to 16.3, which was the root cause of the problem.

This happens in .net 5.0 also every once in a while some of my projects starts getting this error. So anoyed i dont know whats happening or how to fix it always playing with omnisharp setup such a lame extension

@Dzivo
After installing a new SDK, you have to run the dotnet restore command from the root folder of your project to resolve this issue manually (based on my experience!). If you don't want to do it every time, lock the SDK version using the global.json file.

@VahidN the problem is that omnisharp uses wrong ms build version and you have to specify which to use but its not easy to do and its not explained correctly

Was this page helpful?
0 / 5 - 0 ratings