在 TFS 2013 上构建失败但在本地还可以 [英] Build on TFS 2013 failed but okay locally

查看:15
本文介绍了在 TFS 2013 上构建失败但在本地还可以的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我签入代码时,TFS 2013 自动构建了解决方案.在本地 VS 2013 中可以,但在 TFS 中失败.

When I checked in the code, TFS 2013 built the solution automatically. It is okay in local VS 2013 but failed in TFS.

这是摘要.

Summary
FTPProcessor | Any CPU
1 error(s), 56 warning(s) 
$/xxxx/NewServiceHost/New-Branch/NewServiceHost/packageRestore.proj - 0 error(s), 0 warning(s) 
$/xxxx/NewServiceHost/New-Branch/GenericWindowsServices.sln - 1 error(s), 56 warning(s) 
C:Builds1xxxxFTP Processor (New)src.nuget
uget.targets (71): The task factory "CodeTaskFactory" could not be loaded from the assembly "C:Program Files (x86)MSBuild12.0inamd64Microsoft.Build.Tasks.v4.0.dll". Could not load file or assembly 'file:///C:Program Files (x86)MSBuild12.0inamd64Microsoft.Build.Tasks.v4.0.dll' or one of its dependencies. The system cannot find the file specified.
Other Errors 
1 error(s) 
Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

推荐答案

您的 TFS 2013 构建服务器正在使用 MSBuild 12.0,其中 CodeTasksFactory 存在于 Microsoft.Build.Tasks.v12.0.dll 而不是 Microsoft.Build.Tasks.v4.0.dll.

Your TFS 2013 build server is using MSBuild 12.0 where CodeTasksFactory exists in Microsoft.Build.Tasks.v12.0.dll rather than Microsoft.Build.Tasks.v4.0.dll.

理想情况下,您应该执行以下操作:

Ideally you should be doing the following:

1) 打开 NuGet.targets 文件:C:Builds1xxxxFTP 处理器(新)src.nuget uget.targets

1) Open your NuGet.targets file: C:Builds1xxxxFTP Processor (New)src.nuget uget.targets

2) 识别引用旧 DLL 的任务.

2) Identify the task referencing the old DLL.

<UsingTask AssemblyFile="$(MSBuildToolsPath)Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory" >
...

3) 然后像这样证明它:

3) Then future proof it like so:

<UsingTask AssemblyFile="$(MSBuildToolsPath)Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll" TaskFactory="CodeTaskFactory" >
...

这篇关于在 TFS 2013 上构建失败但在本地还可以的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆