question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The "GetReferenceNearestTargetFrameworkTask" task was not found in omnisharp 1.32.16 (latest)

See original GitHub issue

Environment data

NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview3-010431
 Commit:    d72abce213

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100-preview3-010431\

Host (useful for support):
  Version: 3.0.0-preview3-27503-5
  Commit:  3844df9537

.NET Core SDKs installed:
  3.0.100-preview3-010431 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview3-19153-02 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview3-27503-5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview3-27504-2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

VS Code version:

Version: 1.33.1 (user setup) Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8 Date: 2019-04-11T08:27:14.102Z Electron: 3.1.6 Chrome: 66.0.3359.181 Node.js: 10.2.0 V8: 6.6.346.32 OS: Windows_NT x64 10.0.17763

C# Extension version:

1.18.0

Steps to reproduce

Load a solution contain 2 project, let call them A and B which B has A as dependency.

Expected behavior

Both project are loaded.

Actual behavior

A load corectly but B cannot be load with 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\Komi-San-Supporter\.vscode\extensions\ms-vscode.csharp-1.18.0\.omnisharp\1.32.16\msbuild\Current\Bin" directory.

Additional information:

Log file (level debug): omni.log

Despite not installing Visual Studio, the log said:

    MSBuild environment:

Mode: VisualStudio RunningTests: False RunningInVisualStudio: False

In older version, it was Mode: Standalone

I downgrade omnisharp to version 1.32.12-beta.51 and everything work as expected

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
rchandecommented, Apr 12, 2019

@Fubuchi Can you set “omnisharp.path”:'latest" in your VS Code settings? I believe this is fixed now.

2reactions
rchandecommented, Apr 12, 2019

It looks like MSBuild change the heuristics it uses to determine if it’s running in Visual Studio. Now, the omnisharp path for MSBuild matches one of the VS checks (https://github.com/Microsoft/msbuild/blob/master/src/Shared/BuildEnvironmentHelper.cs#L158) so MSBuild sets the VS mode, which results in weird behavior. I think we can work around this by changing the path omnisharp puts it under…

Read more comments on GitHub >

github_iconTop Results From Across the Web

The "GetReferenceNearestTargetFrameworkTask" task was ...
So, I'm using MSBuild to automate build/deploy process for Azure Functions. Everything was working fine until I updated both Visual Studio 2017 ...
Read more >
Why Is The Project File Not Found Even Though I Am Using ...
The GetReferenceNearestTargetFrameworkTask task was not found. when building app project with reference to library project if.NET Core crossplatform. When we ...
Read more >
"The "GetReferenceNearestTargetFrameworkTask" task was ...
"The "GetReferenceNearestTargetFrameworkTask" task was not found." when building app project with reference to library project if .NET Core cross-platform ...
Read more >
Cannot get code completion to work in Visual Studio Code ...
Could not find any CSX files. [info]: OmniSharp.WorkspaceInitializer. Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.
Read more >
omnisharp-vscode - Discover .NET
NET Framework builds of OmniSharp no longer ship with Mono or the MSBuild ... Take the first dotnet cli we find instead of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found