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

OmniSharp.MSBuild.Discovery.MSBuildLocator picks wrong MSBuild path #1094

Closed
DustinCampbell opened this issue Jan 23, 2018 · 62 comments
Closed

Comments

@DustinCampbell
Copy link
Contributor

From @pquiring on December 25, 2017 17:27

Environment data

dotnet --info output:
.NET Command Line Tools (2.1.3)

Product Information:
Version: 2.1.3
Commit SHA-1 hash: a0ca411ca5

Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Apps\dotnet\sdk\2.1.3\

Microsoft .NET Core Shared Framework Host

Version : 2.0.4
Build : 7f262f453d8c8479b9af91d34c013b3aa05bc1ff

VS Code version: 1.19.1

C# Extension version: 1.13.1

Steps to reproduce

Install .Net Core standalone
Install VS Code
Install VS Build Tools with VC++ only (not .NET component)
or
Install VS IDE with VC++ only (not .NET component)
Open .csproj in VS Code.

Expected behavior

OmniSharp runs

Actual behavior

OmniSharp tries to use MSBuild from VC++ and fails.

Starting OmniSharp server at 12/25/2017, 12:02:45 PM
    Target: c:\files\workspace\qt\apps\passwords

OmniSharp server started
    Path: C:\Users\User\.vscode\extensions\ms-vscode.csharp-1.14.0-beta2\.omnisharp\OmniSharp.exe
    PID: 9980

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Visual Studio Build Tools 2017 15.5.27130.2010 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
            2: StandAlone 15.0 - "C:\Users\User\.vscode\extensions\ms-vscode.csharp-1.14.0-beta2\.omnisharp\msbuild\15.0\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Build Tools 2017 15.5.27130.2010 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'c:\files\workspace\qt\apps\passwords'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in c:\files\workspace\qt\apps\passwords
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Resolving projects references
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in 'c:\files\workspace\qt\apps\passwords'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\files\workspace\qt\apps\passwords\passwords.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'c:\files\workspace\qt\apps\passwords'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Stdio.Host
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Stdio.Host
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'c:\files\workspace\qt\apps\passwords' on host 1332.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\files\workspace\qt\apps\passwords\passwords.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\files\workspace\qt\apps\passwords\passwords.csproj'.
c:\files\workspace\qt\apps\passwords\passwords.csproj


If I install .NET in VS Build Tools it works.

How can I force OmniSharp to ignore MSbuild environments that do NOT have .NET included?

Thanks.

Copied from original issue: dotnet/vscode-csharp#1941

@DustinCampbell
Copy link
Contributor Author

From @rchande on January 2, 2018 21:48

@DustinCampbell This is interesting. Seems like we need to actually verify that .NET is also installed for a given MSBuild installation. Thoughts on how we should do that?

@DustinCampbell
Copy link
Contributor Author

@rchande: Sorry for the delay here. We'd probably need to test for the appropriate package(s) here: https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Host/MSBuild/Discovery/Providers/VisualStudioInstanceProvider.cs#L56-L70.

@lmazuel
Copy link

lmazuel commented Jul 9, 2018

Got hit by this as well. Is there at least a workaround? Env variable? Settings?

@nanodeath
Copy link

👍 would like a real workaround. I just uninstalled the MS Build Tools for now.

@pquiring
Copy link

Work around:
Rename "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild" to MSBuild.disabled
or
Rename "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild" to MSBuild.disabled

@littleq0903
Copy link

littleq0903 commented Jul 19, 2018

Succeeded with the workaround from @pquiring, but with copying over targets files:

Copy from "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Microsoft.CSharp.*" to "C:\Users<username>.vscode\extensions\ms-vscode.csharp-1.15.2.omnisharp\1.32.2-beta.21\msbuild\Override"

P.S.

  1. Version numbers like 1.15.2 and 1.32.2-beta.21 may differ due to your environment, modify accordingly.
  2. You would have to create Override folder.
  3. I need Microsoft.CSharp.* targets, this is probably not needed in other cases, just trying to paste the workaround I did here for those who encountered this.

@Shivang44
Copy link

I was not getting autocomplete for Unity3D, but after following @pquiring 's solution, it works -- thanks!

@UncleInf
Copy link

This doens't seem to be solved atleast with vs code 1.27.1
ms-vscode.csharp-1.16.0.omnisharp\1.32.4\msbuild\15.0\Bin

@xavierwarluzel
Copy link

Same problem in vscode today after omnisharp update

@johnnyreilly
Copy link

johnnyreilly commented Sep 11, 2018

This has just started happening to me as well. I'm wondering if there's an issue with the OmniSharp update. Is there a way to pin to the previous version?

@boris-741
Copy link

same problem with 1.16.0.omnisharp and vscode 1.27.1 os windows 7 sp1

@LuizPelegrini
Copy link

LuizPelegrini commented Sep 11, 2018

This error just started happening after updating. 1.16 omnisharp, vscode 1.27.1 windows10 x64

@zvinless
Copy link

zvinless commented Sep 11, 2018

This started happening for me after the 1.16.0 update, too:

  • VSCode 1.27.1
  • macOS High Sierra 10.13.16
  • Mono 5.14.0.177 (Homebrew, also happens if I use Mono MDK instead)
  • .NET Core SDK 2.1.401

@rchande
Copy link

rchande commented Sep 11, 2018

@UncleInf @johnnyreilly @boris-741 @LuizPelegrini @zvinless I'm sorry you're running into issues. From what's reported, it sounds like there's an issue with the "standalone" MSBuild shipped with OmniSharp on Windows. There are a couple of workarounds you can do while we investigate:

Thanks for your patience--we are actively investigating.

@rchande
Copy link

rchande commented Sep 11, 2018

Also @UncleInf @johnnyreilly @boris-741 @LuizPelegrini @zvinless, if you could set "omnisharp.loggingLevel": "debug" in VS Code and share your omnisharp log, that will help us diagnose what's happening.

@LuizPelegrini
Copy link

LuizPelegrini commented Sep 11, 2018

@UncleInf @johnnyreilly @boris-741 @LuizPelegrini @zvinless I'm sorry you're running into issues. From what's reported, it sounds like there's an issue with the "standalone" MSBuild shipped with OmniSharp on Windows. There are a couple of workarounds you can do while we investigate:

Thanks for your patience--we are actively investigating.

Downgrading omnisharp to 1.15 and disabling extension auto update worked for me! Thanks for the support @rchande !

@zvinless
Copy link

@rchande thanks for the help!

I think I'm actually running into a different issue, but here's my log. I noticed the warnings at the end after the extensions update. The actual behavior in VSCode is kind of erratic. Let me know if there is a different place where I should post this.

Starting OmniSharp server at 9/11/2018, 1:21:33 PM
    Target: /Users/zach/repos/project/project.sln

OmniSharp server started with Mono 5.14.0.
    Path: /Users/zach/.vscode/extensions/ms-vscode.csharp-1.16.0/.omnisharp/1.32.4/omnisharp/OmniSharp.exe
    PID: 53464

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 10.13.6 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Mono 15.0 - "/usr/local/Cellar/mono/5.14.0.177/lib/mono/msbuild/15.0/bin"
            2: StandAlone 15.0 - "/Users/zach/.vscode/extensions/ms-vscode.csharp-1.16.0/.omnisharp/1.32.4/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Mono 15.0 - "/usr/local/Cellar/mono/5.14.0.177/lib/mono/msbuild/15.0/bin"
            CscToolPath = /Users/zach/.vscode/extensions/ms-vscode.csharp-1.16.0/.omnisharp/1.32.4/omnisharp/msbuild/15.0/Bin/Roslyn
            CscToolExe = csc.exe
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/zach/repos/project'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.Stdio.Host
        Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/Users/zach/repos/project/project.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/zach/repos/project/UniRx.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/zach/repos/project/Assembly-CSharp-firstpass.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/zach/repos/project/UniRx.Async.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/zach/repos/project/Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/zach/repos/project/UniRx.Examples.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/zach/repos/project/Assembly-CSharp-Editor-firstpass.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/zach/repos/project/Assembly-CSharp-Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/zach/repos/project/UniRx.Async.Editor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/zach/repos/project'.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/zach/repos/project/UniRx.csproj
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Stdio.Host
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Stdio.Host
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/Users/zach/repos/project' on host 53435.
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/zach/repos/project/UniRx.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/zach/repos/project/UniRx.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/zach/repos/project/Assembly-CSharp-firstpass.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/zach/repos/project/Assembly-CSharp-firstpass.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/zach/repos/project/Assembly-CSharp-firstpass.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/zach/repos/project/UniRx.Async.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/zach/repos/project/UniRx.Async.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/zach/repos/project/UniRx.Async.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/zach/repos/project/Assembly-CSharp.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/zach/repos/project/Assembly-CSharp.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/zach/repos/project/Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/zach/repos/project/UniRx.Examples.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/zach/repos/project/UniRx.Examples.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/zach/repos/project/UniRx.Examples.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/zach/repos/project/Assembly-CSharp-Editor-firstpass.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/zach/repos/project/Assembly-CSharp-Editor-firstpass.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/zach/repos/project/Assembly-CSharp-Editor-firstpass.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/zach/repos/project/Assembly-CSharp-Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/zach/repos/project/Assembly-CSharp-Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/zach/repos/project/Assembly-CSharp-Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/zach/repos/project/UniRx.Async.Editor.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/zach/repos/project/UniRx.Async.Editor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/zach/repos/project/UniRx.Async.Editor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: UniRx
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.Async.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Assembly-CSharp-firstpass
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.Async.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.Async.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: UniRx.Async
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Assembly-CSharp
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/Assembly-CSharp-firstpass.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.Async.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.Async.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: UniRx.Examples
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.Async.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Assembly-CSharp-Editor-firstpass
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/Assembly-CSharp-firstpass.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.Async.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.Async.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Assembly-CSharp-Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/Assembly-CSharp-Editor-firstpass.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/Assembly-CSharp-firstpass.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/Assembly-CSharp.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.Async.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.Async.Editor.dll'
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.dll'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: UniRx.Async.Editor
[warn]: OmniSharp.MSBuild.ProjectManager
        Unable to resolve assembly '/Users/zach/repos/project/Temp/bin/Debug/UniRx.Async.dll'

@UncleInf
Copy link

@rchande - atached. I did change logging level to debug, but it seems that I don't get more messages.

Starting OmniSharp server at 9/12/2018, 10:52:49 AM
    Target: c:\_project-loc\Shipping.Master.sln

OmniSharp server started.
    Path: C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\OmniSharp.exe
    PID: 15516

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.1.7601.65536 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 15.0 - "C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to 'C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 15.0 - "C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin"
            CscToolExe = csc.exe
            CscToolPath = C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Roslyn
            MSBuildExtensionsPath = C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild
            MSBuildToolsPath = C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'c:\_project-loc'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.Stdio.Host
        Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in 'c:\_project-loc\Shipping.Master.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\_project-loc\Presentation\Shipping.Web\Shipping.Web.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\_project-loc\Libraries\Shipping.Services\Shipping.Services.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\_project-loc\Libraries\Shipping.Core\Shipping.Core.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\_project-loc\Data\Shipping.Data\Shipping.Data.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\_project-loc\Libraries\DHL\DHL\DHL.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\_project-loc\Libraries\ShippingProviders\ShippingProviders.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'c:\_project-loc'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Stdio.Host
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Stdio.Host
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'c:\_project-loc' on host 10644.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\_project-loc\Presentation\Shipping.Web\Shipping.Web.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\_project-loc\Presentation\Shipping.Web\Shipping.Web.csproj'.
c:\_project-loc\Presentation\Shipping.Web\Shipping.Web.csproj
C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\_project-loc\Libraries\Shipping.Services\Shipping.Services.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\_project-loc\Libraries\Shipping.Services\Shipping.Services.csproj'.
c:\_project-loc\Libraries\Shipping.Services\Shipping.Services.csproj
C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\_project-loc\Libraries\Shipping.Core\Shipping.Core.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file 'c:\_project-loc\Libraries\Shipping.Core\Shipping.Core.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project 'c:\_project-loc\Libraries\Shipping.Core\Shipping.Core.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\_project-loc\Data\Shipping.Data\Shipping.Data.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\_project-loc\Data\Shipping.Data\Shipping.Data.csproj'.
c:\_project-loc\Data\Shipping.Data\Shipping.Data.csproj
C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\_project-loc\Libraries\DHL\DHL\DHL.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\_project-loc\Libraries\DHL\DHL\DHL.csproj'.
c:\_project-loc\Libraries\DHL\DHL\DHL.csproj
C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\the_user\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\_project-loc\Libraries\ShippingProviders\ShippingProviders.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file 'c:\_project-loc\Libraries\ShippingProviders\ShippingProviders.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project 'c:\_project-loc\Libraries\ShippingProviders\ShippingProviders.csproj'
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\_project-loc\Presentation\Shipping.Web\Shipping.Web.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\_project-loc\Libraries\Shipping.Services\Shipping.Services.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Shipping.Core
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\_project-loc\Data\Shipping.Data\Shipping.Data.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\_project-loc\Libraries\DHL\DHL\DHL.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: ShippingProviders

@johnnyreilly
Copy link

Here's my log:

Starting OmniSharp server at 9/12/2018, 3:25:34 PM
    Target: c:\work\the-project-tools\TheProjectTools.sln

OmniSharp server started.
    Path: C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\OmniSharp.exe
    PID: 22844

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 15.0 - "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to 'C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 15.0 - "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin"
            CscToolExe = csc.exe
            CscToolPath = C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Roslyn
            MSBuildExtensionsPath = C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild
            MSBuildToolsPath = C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'c:\work\the-project-tools'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.Stdio.Host
        Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in 'c:\work\the-project-tools\TheProjectTools.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.Web\TheProject.Web.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.Data\TheProject.Data.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.Common\TheProject.Common.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.Domain\TheProject.Domain.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.HangfireHost\TheProject.HangfireHost.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.Stubs\TheProject.Stubs.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.Utilities\TheProject.Utilities.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.Api.Tests\TheProject.Api.Tests.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.Domain.Tests\TheProject.Domain.Tests.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.Data.Tests\TheProject.Data.Tests.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.Web.Shared\TheProject.Web.Shared.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.Web.Shared.Tests\TheProject.Web.Shared.Tests.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.B4B.Api.Tests\TheProject.B4B.Api.Tests.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.Web.Tests\TheProject.Web.Tests.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.B4B.WebApi\TheProject.B4B.WebApi.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\work\the-project-tools\src\TheProject.B4B.WebApi.Tests\TheProject.B4B.WebApi.Tests.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'c:\work\the-project-tools'.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.Web\TheProject.Web.csproj
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Stdio.Host
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Stdio.Host
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'c:\work\the-project-tools' on host 15760.
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.Web\TheProject.Web.csproj'.
c:\work\the-project-tools\src\TheProject.Web\TheProject.Web.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.Data\TheProject.Data.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.Data\TheProject.Data.csproj'.
c:\work\the-project-tools\src\TheProject.Data\TheProject.Data.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.Common\TheProject.Common.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file 'c:\work\the-project-tools\src\TheProject.Common\TheProject.Common.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project 'c:\work\the-project-tools\src\TheProject.Common\TheProject.Common.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.Domain\TheProject.Domain.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.Domain\TheProject.Domain.csproj'.
c:\work\the-project-tools\src\TheProject.Domain\TheProject.Domain.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.HangfireHost\TheProject.HangfireHost.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file 'c:\work\the-project-tools\src\TheProject.HangfireHost\TheProject.HangfireHost.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project 'c:\work\the-project-tools\src\TheProject.HangfireHost\TheProject.HangfireHost.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.Stubs\TheProject.Stubs.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.Stubs\TheProject.Stubs.csproj'.
c:\work\the-project-tools\src\TheProject.Stubs\TheProject.Stubs.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.Utilities\TheProject.Utilities.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.Utilities\TheProject.Utilities.csproj'.
c:\work\the-project-tools\src\TheProject.Utilities\TheProject.Utilities.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.Api.Tests\TheProject.Api.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.Api.Tests\TheProject.Api.Tests.csproj'.
c:\work\the-project-tools\src\TheProject.Api.Tests\TheProject.Api.Tests.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.Domain.Tests\TheProject.Domain.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.Domain.Tests\TheProject.Domain.Tests.csproj'.
c:\work\the-project-tools\src\TheProject.Domain.Tests\TheProject.Domain.Tests.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.Data.Tests\TheProject.Data.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.Data.Tests\TheProject.Data.Tests.csproj'.
c:\work\the-project-tools\src\TheProject.Data.Tests\TheProject.Data.Tests.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.Web.Shared\TheProject.Web.Shared.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.Web.Shared\TheProject.Web.Shared.csproj'.
c:\work\the-project-tools\src\TheProject.Web.Shared\TheProject.Web.Shared.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.Web.Shared.Tests\TheProject.Web.Shared.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.Web.Shared.Tests\TheProject.Web.Shared.Tests.csproj'.
c:\work\the-project-tools\src\TheProject.Web.Shared.Tests\TheProject.Web.Shared.Tests.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.B4B.Api.Tests\TheProject.B4B.Api.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.B4B.Api.Tests\TheProject.B4B.Api.Tests.csproj'.
c:\work\the-project-tools\src\TheProject.B4B.Api.Tests\TheProject.B4B.Api.Tests.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.Web.Tests\TheProject.Web.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.Web.Tests\TheProject.Web.Tests.csproj'.
c:\work\the-project-tools\src\TheProject.Web.Tests\TheProject.Web.Tests.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.B4B.WebApi\TheProject.B4B.WebApi.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.B4B.WebApi\TheProject.B4B.WebApi.csproj'.
c:\work\the-project-tools\src\TheProject.B4B.WebApi\TheProject.B4B.WebApi.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\work\the-project-tools\src\TheProject.B4B.WebApi.Tests\TheProject.B4B.WebApi.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\work\the-project-tools\src\TheProject.B4B.WebApi.Tests\TheProject.B4B.WebApi.Tests.csproj'.
c:\work\the-project-tools\src\TheProject.B4B.WebApi.Tests\TheProject.B4B.WebApi.Tests.csproj
C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1657,5): Error: The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Users\JReilly\.vscode\extensions\ms-vscode.csharp-1.16.0\.omnisharp\1.32.4\msbuild\15.0\Bin" directory.

[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.Web\TheProject.Web.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.Data\TheProject.Data.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: TheProject.Common
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.Domain\TheProject.Domain.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: TheProject.HangfireHost
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.Stubs\TheProject.Stubs.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.Utilities\TheProject.Utilities.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.Api.Tests\TheProject.Api.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.Domain.Tests\TheProject.Domain.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.Data.Tests\TheProject.Data.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.Web.Shared\TheProject.Web.Shared.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.Web.Shared.Tests\TheProject.Web.Shared.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.B4B.Api.Tests\TheProject.B4B.Api.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.Web.Tests\TheProject.Web.Tests.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.B4B.WebApi\TheProject.B4B.WebApi.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\work\the-project-tools\src\TheProject.B4B.WebApi.Tests\TheProject.B4B.WebApi.Tests.csproj

@rchande
Copy link

rchande commented Sep 12, 2018

@UncleInf @johnnyreilly @boris-741 @LuizPelegrini @zvinless We believe we have identified the cause of the "GetReferenceNearestTargetFrameworkTask" issue and we've created a beta of the C# extension that includes the fix. Please install the beta VSIX (https://github.com/OmniSharp/omnisharp-vscode/releases/download/v1.16.1-beta1/csharp-1.16.1-beta1.vsix) and let us know if that resolves the problem

@johnnyreilly
Copy link

I'd love to give you some feedback @rchande but I can't get the VSIX to work - I'm getting a "Windows cannot open this sort of file (.vsix)" error 😢

@rchande
Copy link

rchande commented Sep 12, 2018

@johnnyreilly You can install the VSIX by going to the extensions pane in VS Code and clicking the ellipsis button -> Install from VSIX
image

@johnnyreilly
Copy link

johnnyreilly commented Sep 12, 2018

Thanks - will attempt

Done.

Just firing up now

@johnnyreilly
Copy link

johnnyreilly commented Sep 12, 2018

Installing C# dependencies...
Platform: win32, x86_64

Downloading package 'OmniSharp for Windows (.NET 4.6 / x64)' 	Retrying from 'https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.32.5.zip' (31017 KB).................... Done!
Installing package 'OmniSharp for Windows (.NET 4.6 / x64)'

Downloading package '.NET Core Debugger (Windows / x64)' 	Retrying from 'https://vsdebugger.blob.core.windows.net/coreclr-debug-1-16-0/coreclr-debug-win7-x64.zip' (41984 KB)...

@SebastianPfliegel
Copy link

Having the same issue using C:\Program Files (x86)\Microsoft Visual Studio\2017\SQL\MSBuild\15.0\Bin. For now I renamed a folder to prevent it from using this binary.

@aydjay
Copy link

aydjay commented Mar 19, 2019

I'm having the same issue:

dotnet --info

.NET Core SDK (reflecting any global.json):
 Version:   2.2.105
 Commit:    7cecb35b92

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17134
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.2.105\

Host (useful for support):
  Version: 2.2.3
  Commit:  6b8ad509b6

.NET Core SDKs installed:
  2.2.105 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Startup log:

        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Visual Studio Build Tools 2017 15.7.27703.2000 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
            2: StandAlone 15.0 - "C:\Users\alex\.vscode\extensions\ms-vscode.csharp-1.17.1\.omnisharp\1.32.8\msbuild\15.0\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Build Tools 2017 15.7.27703.2000 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'c:\dev\test'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.WorkspaceInitializer
        Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in 'c:\dev\test'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\dev\test\firstSite\firstSite.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'c:\dev\test'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'c:\dev\test' on host 19476.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\dev\test\firstSite\firstSite.csproj
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\dev\test\firstSite\firstSite.csproj'.
c:\dev\test\firstSite\firstSite.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.  c:\dev\test\firstSite\firstSite.csproj
   at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, Boolean throwOnFileNotExistsError)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext)
   at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings)
   at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings)
   at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
   at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath)
   at OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath)
   at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectLoader loader)
   at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func`1 loader)

[fail]: OmniSharp.MSBuild.ProjectManager
        Attemped to update project that is not loaded: c:\dev\test\firstSite\firstSite.csproj

What is the recommended work around?

@SebastianPfliegel
Copy link

@aydjay rename directory C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\. This way it will not find it in the first place.

@turowicz
Copy link

turowicz commented Apr 5, 2019

I've had this problem in OSX. Went to user settings in VS Code and disabled "Global Mono". It loads theStandAlone 15.0 now.

@HughGrovesArup
Copy link

I've had this issue as well. I'm toying with pushing VS Code + Omnisharp instead of Visual Studio Express for a project I am working on, but am really being put off by this bug. A proper workaround where I could specify where MSBuild lives would be much better.

#1291 (comment)

@jrend
Copy link

jrend commented Jun 17, 2019

I ran into this problem in a .NET Core project, the initial symptoms were many compile errors that boiled down to You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
It turned out that instead of the built-in MSBuild, OmniSharp was selecting the one from VS2017.

With VS 2017

OmniSharp log:

Starting OmniSharp server at 6/17/2019, 1:27:52 PM
    Target: c:\Users\jrend\repos\internal\ffs

OmniSharp server started.
    Path: C:\Users\jrend\.vscode\extensions\ms-vscode.csharp-1.20.0\.omnisharp\1.32.20\OmniSharp.exe
    PID: 13120

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Visual Studio Community 2017 15.9.28307.718 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin"
            2: StandAlone 15.0 - "C:\Users\jrend\.vscode\extensions\ms-vscode.csharp-1.20.0\.omnisharp\1.32.20\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Community 2017 15.9.28307.718 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin"

Result:

Error reported in VS Code:
The type 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. (CS0012)
(and 400+ other errors)
Compilation: works as expected. Seems like the build task uses the extension's MSBuild, but OmniSharp uses the VS2017 one.

After installing VS 2019

OmniSharp log:

Starting OmniSharp server at 6/17/2019, 1:53:48 PM
    Target: c:\Users\jrend\repos\internal\ffs

OmniSharp server started.
    Path: C:\Users\jrend\.vscode\extensions\ms-vscode.csharp-1.20.0\.omnisharp\1.32.20\OmniSharp.exe
    PID: 17352

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 3 MSBuild instance(s)
            1: Visual Studio Community 2017 15.9.28307.718 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin"
            2: Visual Studio Community 2019 16.1.29009.5 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
            3: StandAlone 15.0 - "C:\Users\jrend\.vscode\extensions\ms-vscode.csharp-1.20.0\.omnisharp\1.32.20\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Community 2019 16.1.29009.5 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"

Result:

It works.


Adding $USERPROFILE\.omnisharp\omnisharp.json with specific MSBuildSdksPath as mentioned in dotnet/vscode-csharp#1727 had no effect -- the VS2019 one still got selected.
Adding omnisharp.json in the project directory also didn't have an effect.

I was a curious about this and tried to dig a bit to find out why this happens or what other options are there to control the choice of MSBuild to be used. Seems like it's on purpose that the builtin MSBuild is sorted lower than VS ones (source), which for me seems strange since the current builtin one is MSBuild 16, while VS2017 is MSBuild 15.

Upon seeing this method I see now that it's also not a coincidence that VS 2019 / MSBuild 16 was picked over MSBuild 15; seems like the "pick 16 over 15" rule wouldn't apply to the builtin MSBuild, though, since it gets a lower score. That is very unfortunate, seems like there is a dependency on MSBuild 16 but MSBuild 15 can be picked if you happen not to have a newer VS, which in my case caused some lost time in debugging all of this.

@filipw
Copy link
Member

filipw commented Jul 8, 2019

related: #1545

@jankalfus
Copy link

jankalfus commented Nov 20, 2019

I have the same problem. Here's the output of the build locator:

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Visual Studio Community 2019 16.2.29230.47 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
            2: StandAlone 16.3 - "C:\Users\Honza\.vscode\extensions\ms-vscode.csharp-1.21.7\.omnisharp\1.34.7\.msbuild\Current\Bin"

I've got .NET Core 3.0 SDK installed as well as multiple 2.x versions and VS 2019. The VS 2019 MSBuild probably gets the priority and as a result, I'm getting the following error:

[fail]: OmniSharp.MSBuild.ProjectLoader
        The current .NET SDK does not support targeting .NET Core 3.0.  Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.0.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\Users\Honza\dev\learn\netcorereact\reactivities\API\API.csproj'.
c:\Users\Honza\dev\learn\netcorereact\reactivities\API\API.csproj
C:\Program Files\dotnet\sdk\2.2.103\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): Error: The current .NET SDK does not support targeting .NET Core 3.0.  Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.0.

Update: Upgrading VS to the latest (16.3.x) version fixes the issue.

@B-Esmaili
Copy link

Date is now almost 2020 and we still are facing same issue.for sake of god tell us how to specify msbuild path manually. MSBuildSdksPath is not working for me either.

@filipw
Copy link
Member

filipw commented Dec 23, 2019

please post your OmniSharp log so that we can have a look at what happens in your environment - what appears to be the same issue, is actually a combination of multiple things

@B-Esmaili
Copy link

B-Esmaili commented Dec 23, 2019

Following is log from my Omnisharp console :

Starting OmniSharp server at 12/23/2019, 1:35:56 PM
Target: c:\Users\BEHNAM\Desktop\dnt

OmniSharp server started.
Path: C:\Users\BEHNAM.vscode\extensions\ms-vscode.csharp-1.21.9.omnisharp\1.34.10-beta.6\OmniSharp.exe
PID: 10456

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: C:\Users\BEHNAM.vscode\extensions\ms-vscode.csharp-1.21.9.razor\OmniSharpPlugin\Microsoft.AspNetCore.Razor.OmniSharpPlugin.dll
info: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 6.2.9200.0 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 3 MSBuild instance(s)
1: Visual Studio Enterprise 2019 16.0.28729.10 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
2: Visual Studio Build Tools 2019 16.2.29123.88 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
3: StandAlone 16.3 - "C:\Users\BEHNAM.vscode\extensions\ms-vscode.csharp-1.21.9.omnisharp\1.34.10-beta.6.msbuild\Current\Bin"
trce: OmniSharp.Services.AssemblyLoader
Assembly loaded from path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Utilities.Core.dll
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
SUCCESS: Resolved to 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Utilities.Core.dll' (name-only).
trce: OmniSharp.Services.AssemblyLoader
Assembly loaded from path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Tasks.Core.dll
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
SUCCESS: Resolved to 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Tasks.Core.dll' (name-only).
trce: OmniSharp.Services.AssemblyLoader
Assembly loaded from path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.dll
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
SUCCESS: Resolved to 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.dll' (name-only).
trce: OmniSharp.Services.AssemblyLoader
Assembly loaded from path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Framework.dll
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
SUCCESS: Resolved to 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Framework.dll' (name-only).
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Visual Studio Enterprise 2019 16.0.28729.10 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Attempting to resolve 'Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
trce: OmniSharp.Services.AssemblyLoader
Assembly loaded from path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Utilities.Core.dll
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
SUCCESS: Resolved to 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Utilities.Core.dll' (name-only).
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Attempting to resolve 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
trce: OmniSharp.Services.AssemblyLoader
Assembly loaded from path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Framework.dll
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
SUCCESS: Resolved to 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Framework.dll' (name-only).
trce: OmniSharp.Services.AssemblyLoader
Assembly loaded: Microsoft.CodeAnalysis.Features, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
trce: OmniSharp.Services.AssemblyLoader
Assembly loaded: Microsoft.CodeAnalysis.CSharp.Features, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Attempting to resolve 'Microsoft.CodeAnalysis.VisualBasic.Workspaces, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
FAILURE: Found 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll' but name, 'Microsoft.CodeAnalysis.VisualBasic.Workspaces, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35', did not match.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Attempting to resolve 'Microsoft.CodeAnalysis.VisualBasic.Features, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
FAILURE: Could not locate 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.CodeAnalysis.VisualBasic.Features.dll'.
trce: OmniSharp.HostServicesAggregator
Successfully added Microsoft.CodeAnalysis.Features, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 to host service assemblies.
trce: OmniSharp.HostServicesAggregator
Successfully added Microsoft.CodeAnalysis.CSharp.Features, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 to host service assemblies.
trce: OmniSharp.HostServicesAggregator
Successfully added Microsoft.AspNetCore.Razor.OmniSharpPlugin.StrongNamed, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to host service assemblies.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Attempting to resolve 'SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
FAILURE: Could not locate 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\SQLitePCLRaw.core.dll'.
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:\Users\BEHNAM\Desktop\dnt'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Attempting to resolve 'Microsoft.Build'
trce: OmniSharp.Services.AssemblyLoader
Assembly loaded from path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.dll
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
SUCCESS: Resolved to 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.dll' (name-only).
[dbug]: OmniSharp.MSBuild.ProjectSystem
MSBuild environment:
Mode: VisualStudio
RunningTests: False
RunningInVisualStudio: False
MSBuildToolsDirectory32: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin
MSBuildToolsDirectory64: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64
MSBuildSDKsPath: C:\Program Files\dotnet\sdk\3.1.100\Sdks
CurrentMSBuildConfigurationFile: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe.config
CurrentMSBuildExePath: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe
CurrentMSBuildToolsDirectory: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin
VisualStudioInstallRootDirectory: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
MSBuildExtensionsPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild

No solution files found in 'c:\Users\BEHNAM\Desktop\dnt'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\BEHNAM\Desktop\dnt\dnt.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\Users\BEHNAM\Desktop\dnt'.
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: c:\Users\BEHNAM\Desktop\dnt\dnt.csproj
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Attempting to resolve 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
trce: OmniSharp.Services.AssemblyLoader
Assembly loaded from path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.dll
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
SUCCESS: Resolved to 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.dll' (name-only).
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 'c:\Users\BEHNAM\Desktop\dnt' on host 10544.
[dbug]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 1,
"Command": "/projects"
}
[dbug]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 2,
"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 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.resources.dll'.
[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 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Attempting to resolve 'Microsoft.Build.Tasks.Core.resources, Version=15.1.0.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
FAILURE: Could not locate 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Tasks.Core.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Attempting to resolve 'Microsoft.Build.Tasks.Core.resources, Version=15.1.0.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
FAILURE: Could not locate 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Build.Tasks.Core.resources.dll'.
[dbug]: OmniSharp.Stdio.Host

Trimmed for sake of brevity

@filipw
Copy link
Member

filipw commented Dec 23, 2019

thanks

according to your log OmniSharp sees 3 MsBuild instances:

1: Visual Studio Enterprise 2019 16.0.28729.10 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
2: Visual Studio Build Tools 2019 16.2.29123.88 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
3: StandAlone 16.3 - "C:\Users\BEHNAM.vscode\extensions\ms-vscode.csharp-1.21.9.omnisharp\1.34.10-beta.6.msbuild\Current\Bin"

OmniSharp will actually always select Visual Studio 2019 if you have it, but your version is 16.0.28729.10 which is not compatible with .NET Core 3.1 (16.3 is minimum).
The easiest fix for you is to open up VS 2019 and update it to latest version which is .NET Core 3.1 compatible. Then OmniSharp will use that and work fine.

@B-Esmaili
Copy link

B-Esmaili commented Dec 23, 2019

I did as pquiring's suggestion this time it complains could not find Microsoft.CodeAnalysis.CSharp.dll weird thing is this dll does exists in 'v 1.34.9' build tools directory , question is why it's lacking in v 1.34.10-beta.6 and if installing beta version is not recommended why it is installing automatically?

@B-Esmaili
Copy link

B-Esmaili commented Dec 23, 2019

thanks

according to your log OmniSharp sees 3 MsBuild instances:

1: Visual Studio Enterprise 2019 16.0.28729.10 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
2: Visual Studio Build Tools 2019 16.2.29123.88 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
3: StandAlone 16.3 - "C:\Users\BEHNAM.vscode\extensions\ms-vscode.csharp-1.21.9.omnisharp\1.34.10-beta.6.msbuild\Current\Bin"

OmniSharp will actually always select Visual Studio 2019 if you have it, but your version is 16.0.28729.10 which is not compatible with .NET Core 3.1 (16.3 is minimum).
The easiest fix for you is to open up VS 2019 and update it to latest version which is .NET Core 3.1 compatible. Then OmniSharp will use that and work fine.

Thanks @filipw , but this is why i am here.we should be able to choose which build tool to use shouldn't we?besides i forced Omnishrap to pick it's standalone build tool using pquiring's suggestion (check my previous comment) but still i faced another problem. furthermore VSCode (and omnisharp) are both separate product from VS why i have to update visual studio if want to get update for VSCode ?

@filipw
Copy link
Member

filipw commented Dec 23, 2019

besides i forced Omnishrap to pick it's standalone build tool using pquiring's suggestion (check my previous comment) but still i faced another problem

Please do not use old workarounds because you will only get into trouble. These workarounds are not supported since that logic is internal. If you start messing up the paths it can get even worse.
Your log says explicitly Registered MSBuild instance: Visual Studio Enterprise 2019 16.0.28729.10 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin" which means the VS 2019 is being picked.

furthermore VSCode (and omnisharp) are both separate product from VS why i have to update visual studio if want to get update for VSCode ?

The MsBuild support offered by VS is a lot more sophisticated than the embedded MsBuild that comes with OmniSharp so if VS is present on your machine OmniSharp will use it. .NET Core 3.1 has a breaking change where it doesn't work with MsBuild < 16.3 so having an older build of VS at the same machine leads to an issue.

if installing beta version is not recommended why it is installing automatically?

It only installs beta builds from master if you set "omnisharp.path":"latest" in your config. Please remove it if you do not wish to use beta builds (they will, by their very nature, be unstable).

My recommendation is to remove "omnisharp.path":"latest" to stop using the beta, and upgrade VS 2019 to latest .NET Core 3.1 compatible version.

@filipw
Copy link
Member

filipw commented Dec 23, 2019

we should be able to choose which build tool to use shouldn't we?

this is supported already, however it's a very advanced feature. I would only recommend using it for testing scenarios and OmniSharp development, or supporting more esoteric Linux-based OS where discovery doesn't work well.

You can read about it here #1545 (comment)

For regular use cases it is not needed and it should be enough to do not have outdated VS or have no VS at all on the machine.

@filipw
Copy link
Member

filipw commented Dec 23, 2019

I will close this issue to not create further confusion. The MsBuild instance scoring has been improved in the recent months.

  • on Windows we don't select VS2017 anymore
  • on Windows, if you have VS2019 installed, make sure it's at least 16.3 to use .NET core 3.1. OmniSharp will use VS2019 over its embedded instance.
  • on *nix we select only Mono 6.4.0+
  • on *nix we don't set mono paths for the embedded MsBuild instance
  • embedd MsBuild was upgraded to 16.3 (16.4 in beta releases already)

If you have further problems, please open a new issue.
If you need to manually set MsBuild path (not recommended, but use at your own risk), see #1545 (comment)

@filipw filipw closed this as completed Dec 23, 2019
@jrend
Copy link

jrend commented Jan 9, 2020

on Windows, if you have VS2019 installed, make sure it's at least 16.3 to use .NET core 3.1. OmniSharp will use VS2019 over its embedded instance.

@filipw This doesn't sound like a good solution. Why would OmniSharp choose something smaller than 16.3 if it can't use it? Especially when it ships a compatible embedded MsBuild 16.3? The selection logic still sounds flawed to me.

I'm willing to put some time into a PR that tries to do something like respect the current selection preference order, but skip what is not compatible (i.e. skip versions smaller than 16.3, 16.4 in beta), do you think that makes sense?

@filipw
Copy link
Member

filipw commented Jan 9, 2020

@filipw This doesn't sound like a good solution. Why would OmniSharp choose something smaller than 16.3 if it can't use it? Especially when it ships a compatible embedded MsBuild 16.3? The selection logic still sounds flawed to me.

the instance is currently selected before the target framework is known (since, we need the msbuild instance to read the csproj file in the first place).
therefore we don't know if we are selecting for .NET Core 3.1, .NET Core 2.0, .desktop .NET, .NET Standard etc.

Since VS2019 msbuild instance is in most cases the best choice, we didn't want to explicitly exclude <16.3 yet as that might be detrimental for other (.NET Core 3.x) users. However as 16.3+ becomes more and more popular it might be a good idea to make that a cut off point.

We already did exclude VS2017 completely from the selection for that very reason.

@jrend
Copy link

jrend commented Jan 9, 2020

OK so my last take on this :)
The embedded version is always known, so could that be used as the minimum required version to filter the versions found on the system? That would also bring users the benefit of a more up-to-date MSBuild anyway (at least I hope it would be a benefit the vast majority of the time). And if someone really needs to match an older version that works for a certain target framework, they could override it with an explicit path.

I am assuming that the embedded MSBuild works for all target frameworks; if it doesn't then I guess there is really no better way :(

@filipw
Copy link
Member

filipw commented Jan 9, 2020

unfortunately the embedded msbuild is not functionally equivalent to that what ships with mono or VS itself, this is particularly relevant for example for unity projects or projects with custom SDK, and should normally be the last resort fallback.

just like we eliminated VS2017 from being discovered though, I can imagine we will soon eliminate VS2019 <16.3 too which will make this issue go away.

That said, I don't think it's a terrible assumption that if you have VS2019 installed and want to do .NET Core 3.1 on your machine, your VS2019 will be updated accordingly.

@juniobiel
Copy link

I having trouble to charge intellisense on VSCODE to Unity. I used dotnet msbuild Assembly-CSharp.csproj -target:Clean and the Omnisharp restarted and solved my problem.

@YaseenYo
Copy link

YaseenYo commented Jun 19, 2021

Work around:
Rename "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild" to MSBuild.disabled
or
Rename "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild" to MSBuild.disabled

after struggling for couple of days finally this solution worked out for me. Thank you

@Dzivo
Copy link

Dzivo commented Aug 29, 2021

Ok wtf i just installed VS again (3 years later) i need for a project and it broke all my VS Code projects. Any work being done on this matter ? Why the f*** cant we choose which MSBuild will be used 1: Visual Studio Community 2019 16.11.31624.102 16.11.0 OR 2: StandAlone 17.0.0

@filipw
Copy link
Member

filipw commented Aug 29, 2021

you can override the used MSBuild using omnisharp.json. see this

@OmniSharp OmniSharp locked as resolved and limited conversation to collaborators Aug 29, 2021
@filipw
Copy link
Member

filipw commented Aug 29, 2021

If VS is installed on the machine, it will be preferred over the bundled MSBuild. You can disable that and force OmniSharp to use only its own MSBuild by adding an omnisharp.json file to the root of your project with the content

{
   "msbuild": {
       "useBundledOnly": true
   }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests