【发布时间】:2015-05-30 22:01:13
【问题描述】:
一段时间以来,我遇到了 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)
这个问题是非常间歇性的,只需重试构建即可绕过它。有没有其他人遇到过这个?有什么解决办法吗?
【问题讨论】:
-
这是什么版本的构建代理?
-
看起来像 v5?基于此服务 URL:/Build/v5.0/Servies
-
恐怕是网络服务版本。如果您还没有升级到 VS 2013 Update 4,您应该尝试升级,它有许多 git build 更新和错误修复。
-
我刚刚完成升级并在大约 16 次构建后再次收到错误。
-
我们也间歇性地看到此错误。我们所有的 TFS 服务器都在运行 VS/TFS 2013 Update 4。msbuild 日志包含以下附加消息:C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\BuildInfo\Microsoft.VisualStudio.ReleaseManagement.BuildInfo。目标(147,5):警告:“LibGit2Sharp.Core.NativeMethods”的类型初始化程序引发异常。