MSB4036诊断代码

本文介绍MSB4036错误代码。

消息文本

MSB4036: The 'value' 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 'value' directory.

注解

当 MSBuild 尝试加载任务时出现此错误,此时可能找不到该任务,或者找到的内容无法作为任务加载。 错误消息中提供了任务名称。 使用任务的名称,尝试确定该任务是你的任务之一还是系统任务。 检查元素中 UsingTask 引用的任务名称,并确保它正确。 请参阅 配置目标和任务

如果任务是您正在开发中的,请确保任务类 public 符合建议,并实现 Microsoft.Build.Framework.ITask。 此外,请确保任务及其可传递依赖项可加载。 对于 .NET Core,可以检查 .NET 程序集加载日志记录。 请参阅 如何在 .NET 中使用和调试程序集可卸载性。 对于 .NET Framework 任务,可以查看 Fusion 日志

如果任务不是你自己的自定义任务,则 MSBuild、.NET SDK 或 Visual Studio 安装可能存在损坏问题。 重新安装这些工具可能会解决问题。

适用对象

MSBuild 的所有版本