解决方案的新开发人员。我有源代码。当我尝试编译时出现以下错误。
之前,我在另一台计算机上解决了这个问题,方法是让项目的另一个开发人员压缩他的文件夹并将其发送给我。但我想了解如果我是这个项目的新手,我将如何解决这个问题。假设我不必依赖某人将压缩后的 .target 文件夹发送给我。
错误:
C:\Users\boyd\Source\Repos\insightstobehavior\Classroom_Package.proj(3,11):
error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual S
tudio\2017\Community\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targ
ets" was not found. Also, tried to find "MSBuildCommunityTasks\MSBuild.Communit
y.Tasks.Targets" in the fallback search path(s) for $(MSBuildExtensionsPath) -
"C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Progra
m Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.e
xe.Config". Confirm that the path in the <Import> declaration is correct, and t
hat the file exists on disk in one of the search paths.
来自.project-
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
最佳答案
error MSB4226 MSBuild.Community.Tasks.Targets" was not found
要解决此问题,您应该安装 msbuildtasks
msi 安装程序:
您可以查看 readme.md此 MSBuild 社区任务的一部分:
In order to use the tasks in this project, you need to import the MSBuild.Community.Tasks.Targets files.
If you installed the project with the msi installer, you can use the following.
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
安装该 msi 文件后,您将找到文件 MSBuild.Community.Tasks.Targets
在路径 C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks
.
这将解决此问题。
希望这对您有所帮助。
关于c# - 找不到错误 MSB4226 MSBuild.Community.Tasks.Targets,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53107074/