首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MSBuild.Community.Tasks与vs2017的问题

MSBuild.Community.Tasks与vs2017的问题
EN

Stack Overflow用户
提问于 2017-04-07 15:15:03
回答 3查看 6.3K关注 0票数 12

各位,我有一套服务是在2012年首次创建的,多年来,这些服务都是与Vs2010、Vs2013和Vs2015无缝构建的。

当我尝试用Vs2017构建时,我得到了

无法从程序集加载MSBuild.Community.Tasks.Attrib任务,程序集位于C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\MSBuildCommunityTasks文件夹下,但是\2017\Professional\MSBuild文件夹下没有MSBuildCommunityTasks文件夹。

这是完整的错误

代码语言:javascript
复制
C:\working\MySolution\build\Build.proj" (default target) (1) ->
(SetAssemblyVersion target) ->
  C:\working\MySolution\build\Build.proj(100,5): error MSB4062: The "MSBuild.Community.Tasks.Attrib" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll. 
  Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll' or one of its dependencies. 
  The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Vs2015和Vs2017之间发生了什么变化?

我该怎么做才能解决这个问题?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2017-04-10 13:16:21

显式设置MSBuildCommunityTasksPath属性可以解决问题。

我是在我的build.proj文件的顶部这样做的。

(出于历史原因,我们将社区构建任务保留在回购中,这就是为什么将其设置为主干下的位置)

代码语言:javascript
复制
<MSBuildCommunityTasksPath>$(trunk)\Ref\Build\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
票数 3
EN

Stack Overflow用户

发布于 2017-09-14 19:34:23

这些扩展很可能安装在'C:\Program (x86)\MSBuild‘中。因此,目前我在proj中显式地将变量设置为一种解决方法。

代码语言:javascript
复制
<MSBuildExtensionsPath>C:\Program Files (x86)\MSBuild</MSBuildExtensionsPath>
票数 3
EN

Stack Overflow用户

发布于 2019-01-21 20:54:11

在.Net单独组件部分中安装VS2017 Framework3.5开发工具,修复了我的构建。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43281620

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档