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 outputs error The "GetReferenceNearestTargetFrameworkTask" task was not found. #40721

Closed
pquiring opened this issue Dec 22, 2017 · 5 comments
Assignees
Labels
tasks Task system issues

Comments

@pquiring
Copy link

  • VSCode Version: 1.19.1
  • OS Version: Win10 1709

Steps to Reproduce:

  1. Load certain .csproj files
  2. Get following error message:

OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
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 in the project file, or in the *.tasks files located in the
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin" directory.

Reproduces without extensions: No (OmniSharp is an extension)

This problem only happens with certain projects. When it happens OmniSharp doesn't run. I've tried many solns posted on stackoverflow such as make sure .Net 1.x is installed ,etc.
Problem is somewhat erratic, hard to find cause.

@vscodebot vscodebot bot added the tasks Task system issues label Dec 22, 2017
@pquiring
Copy link
Author

Seems to happen to projects that reference another project. Standalone projects seem to work fine.

@pquiring
Copy link
Author

Has to do with having Visual Studio installed. Output shows both are installed and OmniSharp picks VisualStudio instead of .NET Core.
How do I tell OmniSharp NOT to use Visual Studio?
I have to uninstall Visual Studio to fix this issue.

@pquiring
Copy link
Author

Here is sample output:
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.13.1.omnisharp\msbuild\15.0\Bin"

@pquiring
Copy link
Author

This is actually an OmniSharp bug so I've opened a bug there:

dotnet/vscode-csharp#1941

@dbaeumer
Copy link
Member

dbaeumer commented Jan 8, 2018

@pquiring thanks. Closing then.

@dbaeumer dbaeumer closed this as completed Jan 8, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tasks Task system issues
Projects
None yet
Development

No branches or pull requests

2 participants