Omnisharp-roslyn: Omnisharp does not use msbuild bundled with .NET Core SDK

Created on 26 Sep 2019  路  9Comments  路  Source: OmniSharp/omnisharp-roslyn

I'm trying out .NET Core for the first time. I installed the .NET Core 3.0 SDK and the latest C Sharp plugin for VS Code. I don't have Visual Studio or Mono installed on my machine. The only two instances of MSBuild on my machine are the one bundled with the .NET Core SDK and the stand alone instance bundled with Omnisharp.

I created a project by following the getting started guide for .NET Core

dotnet new webapi -n api

I fired up VS Code and installed the C# Plugin. I immediately got this error:

[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file '/Users/robert/Code/facet-next/api/api.csproj'.
/Users/robert/Code/facet-next/api/api.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.  /Users/robert/Code/facet-next/api/api.csproj

I've dug through the Omnisharp source code and all the previous issues with a similar error and I believe the root cause is that there is no MSBuildInstanceProvider for locating the MSBuild instance that is included with the .NET Core SDK. Omnisharp only looks for DevConsole, VisualStudio, Mono or StandAlone (which looks for the stand alone MSBuild bundled with Omnisharp).

The logs show that it only finds one instance of MSBuild - the one bundled with Omnisharp.

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 16.0 - "/Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin"

MSBuildLocater does not find the MSBuild instance located in the .NET Core SDK.

Omnisharp proceeds to use the stand alone MSBuild instance. Later, when MSBuild loads the build environment, it sets the MSBuildSDKsPath based on the location of the stand alone MSBuild instance. It simply appends "Sdks" to the path where the current MSBuild is located. In this case, that ends up being:

MSBuildSDKsPath: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Sdks

This folder doesn't exist because the stand alone instance of MSBuild bundled with Omnisharp does not include any Sdks.

I can work around this issue by setting

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

The legacy sdk resolver will run the dotnet cli, extract the MSBuild SDK path and set the MSBuildSDKsPath environment variable to the MSBuild SDK installed with .NET Core. This overrides the MSBuildSDKsPath property in Microsoft.Build.Shared.BuildEnvironmentHelper.

So ultimately, using the legacy SDK resolver ends up using the stand alone MSBuild instance bundled with Omnisharp, but using the MSBuild SDKs in the .NET Core SDK.

I hit the exact same issue on both my MacOS and Windows 10 machines. This makes the out of box experience for .NET Core + VS Code REALLY bad. I followed the setup instructions for .NET Core and VS Code and it just doesn't work. I had to read through a bunch of Github issues to find an undocumented flag (UseLegacySdkResolver) that, apparently, I shouldn't really be using.

As a node.js dev wanting to try out .NET Core, I'm almost ready to give up on .NET Core.

msbuild

Most helpful comment

@lixiaoqiang There is really no need for such a foul language.
I think we should all respect that 80+ contributors in this repo, many of which are not MS employees, are working very hard to accommodate to everything that is new in .Net Core 3.0. It has only been a few days since .Net Core 3.0 was released and I think we should all accept that things might be a little rough around the edges.

All 9 comments

Here is some relevant debug info

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

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

Host (useful for support):
  Version: 3.0.0
  Commit:  7d57652f33

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

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

And the Omnisharp logs

Starting OmniSharp server at 9/25/2019, 11:07:00 PM
    Target: /Users/robert/Code/facet-next

OmniSharp server started.
    Path: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/run
    PID: 51162

[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded: OmniSharp.Cake
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Cake, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded: OmniSharp.DotNetTest
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.DotNetTest, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded: OmniSharp.Host
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Host, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded: OmniSharp.MSBuild
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.MSBuild, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded: OmniSharp.Roslyn
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Roslyn, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded: OmniSharp.Roslyn.CSharp
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Roslyn.CSharp, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded: OmniSharp.Script
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Script, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded: OmniSharp.Shared
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Shared, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded from path: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.razor/OmniSharpPlugin/Microsoft.AspNetCore.Razor.OmniSharpPlugin.dll
[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 10.14.6 (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 - "/Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin"
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded from path: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Utilities.Core.dll
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        SUCCESS: Resolved to '/Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Utilities.Core.dll' (name-only).
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded from path: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Tasks.Core.dll
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        SUCCESS: Resolved to '/Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Tasks.Core.dll' (name-only).
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded from path: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Framework.dll
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        SUCCESS: Resolved to '/Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Framework.dll' (name-only).
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded from path: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.Build.dll
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        SUCCESS: Resolved to '/Users/robert/.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 '/Users/robert/.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 - "/Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin"
            MSBuildExtensionsPath = /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild
            BypassFrameworkInstallChecks = true
            CscToolPath = /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded: Microsoft.CodeAnalysis.Features, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
[trce]: OmniSharp.Services.AssemblyLoader
        Assembly loaded: Microsoft.CodeAnalysis.CSharp.Features, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
[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 '/Users/robert/.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 '/Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.VisualBasic.Features.dll'.
[trce]: OmniSharp.HostServicesAggregator
        Successfully added Microsoft.CodeAnalysis.Features, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 to host service assemblies.
[trce]: OmniSharp.HostServicesAggregator
        Successfully added Microsoft.CodeAnalysis.CSharp.Features, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 to host service assemblies.
[trce]: OmniSharp.HostServicesAggregator
        Successfully added Microsoft.AspNetCore.Razor.OmniSharpPlugin.StrongNamed, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to host service assemblies.
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/robert/Code/facet-next'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[dbug]: OmniSharp.MSBuild.ProjectSystem
        MSBuild environment: 
Mode: Standalone
RunningTests: False
RunningInVisualStudio: False
MSBuildToolsDirectory32: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin
MSBuildToolsDirectory64: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin
MSBuildSDKsPath: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Sdks
CurrentMSBuildConfigurationFile: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/MSBuild.dll.config
CurrentMSBuildExePath: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/MSBuild.dll
CurrentMSBuildToolsDirectory: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin
VisualStudioInstallRootDirectory: 
MSBuildExtensionsPath: /Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin

[dbug]: OmniSharp.MSBuild.ProjectLoader
        'MSBuildExtensionsPath' set to '/Users/robert/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild'
[dbug]: OmniSharp.MSBuild.ProjectLoader
        'CscToolPath' set to '/Users/robert/.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 '/Users/robert/Code/facet-next'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/robert/Code/facet-next/api/api.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/robert/Code/facet-next'.
[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/robert/Code/facet-next/api/api.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 '/Users/robert/Code/facet-next' on host 50980.
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 8,
  "Command": "/projects"
}
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 7,
  "Command": "/projects"
}
[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 '/Users/robert/.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 '/Users/robert/.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 '/Users/robert/.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 '/Users/robert/Code/facet-next/api/api.csproj'.
/Users/robert/Code/facet-next/api/api.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.  /Users/robert/Code/facet-next/api/api.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 <51a8efd7131340a2a56fa19745529dbf>:0 
  at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath) [0x0000d] in <51a8efd7131340a2a56fa19745529dbf>:0 
  at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectIdInfo projectIdInfo, OmniSharp.MSBuild.ProjectLoader loader) [0x00015] in <51a8efd7131340a2a56fa19745529dbf>:0 
  at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass29_0.<LoadProject>b__0 () [0x00000] in <51a8efd7131340a2a56fa19745529dbf>: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 <51a8efd7131340a2a56fa19745529dbf>:0 

[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: /Users/robert/Code/facet-next/api/api.csproj
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 8,
  "Command": "/projects",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "MsBuild": {
      "SolutionPath": "/Users/robert/Code/facet-next",
      "Projects": []
    },
    "Script": {
      "Projects": []
    }
  },
  "Seq": 60,
  "Type": "response"
}
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 7,
  "Command": "/projects",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "MsBuild": {
      "SolutionPath": "/Users/robert/Code/facet-next",
      "Projects": []
    },
    "Script": {
      "Projects": []
    }
  },
  "Seq": 61,
  "Type": "response"
}
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 9,
  "Command": "/projects"
}
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 9,
  "Command": "/projects",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "MsBuild": {
      "SolutionPath": "/Users/robert/Code/facet-next",
      "Projects": []
    },
    "Script": {
      "Projects": []
    }
  },
  "Seq": 74,
  "Type": "response"
}

I fixed the issue by removing all sdks except 3.0 and all runtimes except 3.0 and installed latest mono (6.4) https://www.mono-project.com/download/stable/

I do not need to use the legacy sdk resolver.

I am using macOS Mojave.

I am afraid to install other sdks I need =)

@akshita31 @filipw @jonsequitur Does ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/ have #1606 or not? Is there a release with #1606 yet if not?

the latest stable release doesn't have a #1606 yet
however, it's available in the beta build 1.34.4-beta.7 which can be activated in VS Code by adding the setting:

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

This will download this prerelease OmniSharp to VS Code.

It has been confirmed by multiple users that this build (and #1606) fixes the problem on Windows 10 but not on other platforms.
For that we have a follow up PR that's not merged yet - https://github.com/OmniSharp/omnisharp-roslyn/pull/1612.
It should hopefully fix it on other platforms - at least it has resolved it on the repro machines I had.

@lixiaoqiang There is really no need for such a foul language.
I think we should all respect that 80+ contributors in this repo, many of which are not MS employees, are working very hard to accommodate to everything that is new in .Net Core 3.0. It has only been a few days since .Net Core 3.0 was released and I think we should all accept that things might be a little rough around the edges.

@seesharper
I'm very sorry for my words.
I've use NET Core 3.0 every version and developed some useful tools, but now after change my code.
The tools can't be build now. Sorry for my extreme word.

@rsweeney21 thanks for the issue. It is not necessary for OmniSharp to ship SDKs (in fact it shouldn't). However you ran into a rather unfortunate issue caused by incompatibility with the .NET Core 3.0 RTM release that plagued OmniSharp last week.

The issue should be resolved in the latest 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.

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.

Was this page helpful?
0 / 5 - 0 ratings