TFS 2013 Throws Lib2GitSharp Error During Build/Deploy (Intermittent)

自闭症网瘾萝莉.ら 提交于 2019-12-02 23:36:25
cpoDesign

I know it is a little bit late for answer but it might help someone else

answer by Buck Hodges

We have now gotten to the bottom of this issue after debugging it with Manoj and customer support. It affected gated checkin of continuous delivery of Azure deployments as part of the build process when using the Azure SDK 2.5 or older. The workaround is to add /p:GenerateBuildInfoConfigFile=false to the msbuild arguments in your build definition. We are working on updating the build VM in production, but that will take 24-48 hours to propagate to all build pools.

You might want to read more in context here https://social.msdn.microsoft.com/Forums/en-US/5a0d1950-1367-41a6-9171-676a0d0e93c1/tfs-online-getted-checkin-build-failures-vs-online-tfs-online-team-need-to-look-into-it?forum=TFService

Alternative solution based on comments

If you have VS installed on your build server, make sure you have opened it and licensed it. by @Phill

Strangely enough for me, I was getting the same error in the build logs:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\BuildInfo\Microsoft.VisualStudio.ReleaseManagement.BuildInfo.targets (147): The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. 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)

I was able to simply RETRY the build, and it did not fail on the second try. So for me it was a transitory build issue.

Although late to the party, experienced this error recently and while the solution marked as the answer worked for that build, the error was fixed (and the switch removed) when Visual Studio 2012 was upgraded to Visual Studio 2015 Update 3 on the build server which was running TFS 2015 Update 3.

I hit this after I had upgraded my TFS 2013 XAML build machine to TFS 2015.

I had also changed the user that TFS 2015 XAML build used to run the build (service.

The Fix:

I had to log into the TFS 2015 XAML build machine as that new user and launch VS (I was using VS2013).

It ran through it's first time launch questions and setup.

I still saw the Lib2GitSharp Error issue sometimes after that.

Then I also logged VS (on the TFS 2015 XAML build machine) into a valid VS account.

I have not seen the Lib2GitSharp Error since and I never used the /p:GenerateBuildInfoConfigFile=false option.

I resolved this error by adding the build account to the local administrators group on the build machine.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!