The "GetReferenceNearestTargetFrameworkTask" task was not found in omnisharp 1.32.16 (latest)
See original GitHub issueEnvironment 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:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Fubuchi Can you set “omnisharp.path”:'latest" in your VS Code settings? I believe this is fixed now.
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…