本文介绍MSB4278错误代码。
消息文本
MSB4278: The imported file 'value' does not exist and appears to be part of a Visual Studio component. This file may require MSBuild.exe in order to be imported successfully, and so may fail to build in the dotnet CLI.
注解
使用 dotnet build 并尝试导入文件时,会发生此错误,但导入的文件需要 Visual Studio 生成文件,而 dotnet build 该文件无权访问。 例如,当你尝试使用 Sdk 构建不是 SDK 风格的旧项目(该项目的 Project 元素上没有 dotnet build 属性)时,会出现这种情况。 该 dotnet build 命令只能生成 SDK 样式的项目。 请参阅 使用 MSBuild 项目 SDK。
如果尝试使用.vcxproj构建一个C++项目(dotnet build),也可能发生此错误。
决议
使用 MSBuild.exe 或 Visual Studio 生成项目。 检查是否已在生成计算机上安装 Visual Studio,以及是否已安装 .NET 桌面开发 工作负载。
适用对象
MSBuild 的所有版本