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

标签 visual-studio unity-game-engine 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/47797510/

相关文章:

visual-studio - 如何从命令行编译 MSVC 项目中的单个源文件?

c# - Debug模式下的 Visual Studio 行突出显示

c# - Unity 5 UI - 分配 Dropdown.value 导致崩溃

c# - 如何: Project Architecture for Unity3D or Spaghetti code?

java - 是否可以在android中捕获屏幕截图并将其保存到统一的图库中

c# - 如何在 Web 应用程序 ASPX 代码前页面中使用 C# 7?

c# - 从 Visual Studio 编辑器获取文件路径

visual-studio - SQL Server Management Studio 解决方案与 Visual Studio 项目

.net - 在 VS2017 中找不到 ADO.net 实体数据模型模板

c# - 将 C# 7.1 与 MSBuild 结合使用