TFS 2013在构建/部署期间引发Lib2GitSharp错误(间歇性)

Rya*_*oza 28 .net c# tfs tfs2013

有一段时间了,我一直遇到Team Foundation Server构建/部署过程的问题,间歇性地抛出以下错误:

Unhandled Exception: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at LibGit2Sharp.Core.NativeMethods.git_threads_init()
at LibGit2Sharp.Core.NativeMethods.LibraryLifetimeObject..ctor()
at LibGit2Sharp.Core.NativeMethods..cctor()
--- End of inner exception stack trace ---
at LibGit2Sharp.Core.NativeMethods.RemoveHandle()
at LibGit2Sharp.Core.NativeMethods.LibraryLifetimeObject.Finalize()
Exception Message: MSBuild error 255 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)
Run Code Online (Sandbox Code Playgroud)

这个问题非常间歇性,可以通过简单地重试构建来绕过它.有没有其他人遇到这个?有解决方案吗

cpo*_*ign 33

我知道答案有点晚,但它可能对其他人有所帮助

巴克霍奇斯回答

在使用Manoj和客户支持进行调试之后,我们现在已经深入了解了这个问题.在使用Azure SDK 2.5或更早版本时,它会影响Azure部署持续交付的门控签名,作为构建过程的一部分.解决方法是将/ p:GenerateBuildInfoConfigFile = false添加到构建定义中的msbuild参数.我们正在努力更新生产中的构建VM,但这需要24-48小时才能传播到所有构建池.

添加msbuild参数

你可能想在这里阅读更多内容 https://social.msdn.microsoft.com/Forums/en-US/5a0d1950-1367-41a6-9171-676a0d0e93c1/tfs-online-getted-checkin-build-failures-vs -online-TFS-在线团队需要对查找到-呢?论坛= TFService

基于评论的替代解决方案

如果在构建服务器上安装了VS,请确保已打开并获得许可.通过@Phill

  • 是的,我有他们(在盒子上安装VS 2015企业),但显然VS 2015尚未开放或许可.一旦我在该盒子上打开VS 2015,并使用有效的MSDN用户登录,那么即使使用该参数,该服务器上的构建也能正常工作. (6认同)