visual-studio - 找不到 "GetReferenceNearestTargetFrameworkTask"任务

标签 visual-studio unity3d visual-studio-2017

我在 VS 2017 社区中遇到自动完成问题。

以前我在学校有 VS 2017 Enterprise,但 key 已过期,所以我转到了社区。

以前,一切正常,但现在根本不起作用。

我在 Stack Overflow 上找到了解决方案 here但它不起作用,所以在 GitHub 上找到了另一个解决方案 here .

我得到了这个:

Build FAILED.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1601,5): error MSB4036: 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. 0 Warning(s) 1 Error(s)

Time Elapsed 00:00:00.11

你知道下一步该做什么吗?

最佳答案

我收到了相同的错误消息,但问题不同。

所以,我正在使用 MSBuild 来自动化 Azure Functions 的构建/部署过程。一切正常,直到我更新了 Visual Studio 2017 和 Visual Studio Build Tools 2017,此时我开始收到此错误。准确地说,我只在使用 MSBuild 时遇到此错误,从 VS 手动构建项目工作正常。

就我而言,我已经按照@Programmer 的回答设置了所有内容。 但是当我使用 MSBuild 时,我发现我还必须安装 NuGet 目标和构建任务,它们是 Visual Studio 构建工具的一部分。

Screenshot of Visual Studio Installer

关于visual-studio - 找不到 "GetReferenceNearestTargetFrameworkTask"任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50482892/

相关文章:

Visual Studio 2015 中未检测到 Android 手机

android - 统一二维 : How to support multi platform and different aspect ratio devices in Unity 2D?

visual-studio - 必须安装WiX Toolset v3.11(或更高版本)构建工具才能构建此项目

c# - Debug.Log 会导致 Unity 构建延迟吗?

关于设置串口 com 端口的 C++ 问题

wpf - 尝试在 Visual Studio 2017 中查看应用程序属性页面时出错

c - 并排配置故障?

c++ - 无法访问Qt5中对话框的成员

c# - OpenQA.Selenium.DriverServiceNotFoundException

c# - 插值对象碰撞卡住