LibGit2Sharp versioning error MSBuild

3

I'm getting the following error:

Error   17  System.IO.FileLoadException: Could not load file or assembly 
'LibGit2Sharp, Version=0.14.30212.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
File name: 'LibGit2Sharp, Version=0.14.30212.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' ---> 
System.IO.FileLoadException: A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

I don't even use github, but it seems like I need to have this reference in.

I have tried adding version 14.0, 14.1, 15.0 and 21, but they all throw this error. It seems like it wants version 14.30212.0 exactly and won't accept any other versions. I've tried to manually change version 14.1 to 14.30212.0 and rebuild it, but since I don't have the .snk or .pfx file to sign it with, the public key is different, so it won't accept that assembly either.

How can I remove this reference completely (Microsoft.Teamfoundation.Build.Activities references it too), or at least where can I find this specific version (can't find it anywhere).

tfs
msbuild
tfsbuild
libgit2sharp
asked on Stack Overflow Mar 2, 2015 by Pierre

3 Answers

2

Sorry , I would like to add a comment but I don't have enough reputation. I would like to share with you that I have the same issue. And I found that it seems to be a bug in my case with TFS 2015 CTP/VsoAgent

The LibGit2Sharp version inside C:\Program Files\Microsoft Team Foundation Server 14.0\Tools is a different version that the one that the VsoAgent is looking for. In mi case VsoAgent is looking for Version=0.19.30619.0 but the version installed with the TFS CTP 2015 was 0.17.XXX

Moreover, the LibGit2Sharp version shipped with TFS is a custom one, so is likely that is not going to work if you try to replace it with the one from GitHub.

So, I'm looking at this at the moment. My legacy Git build still working on TFS 2015 but I can't create a vNext currently :(

answered on Stack Overflow Mar 2, 2015 by jrodrigv
2

I finally got it semi-working.

I went on TFS in my custom activities directory and deleted all of the Microsoft.Teamfoundation.* files.

I still get the error when I build my project, but I just set the "Build Action" to "none" on the xaml file's properties, so it doesn't build the xaml file.

The build server now executes like it did before, without throwing the missing assembly error.

If you have a better way of fixing this, feel free to post it and I'll mark it as the answer :)

answered on Stack Overflow Mar 2, 2015 by Pierre
1

You should disable strong name signing in order to run the build in VSO. If you have installed VS 2015 CTP, you should use below commands in build agent machine to achieve this:

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\sn.exe -Vr *,*

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\x64\sn.exe -Vr *,*

Please not that the switch -Vr is case sensitive.

answered on Stack Overflow Mar 12, 2015 by SKJ

User contributions licensed under CC BY-SA 3.0