Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Git Version | Version Git Error connecting to TFS GIT repository using c#
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Git Version | Version Git

Subjects Author Language Messages Last message
Error connecting to TFS GIT repository using c#
Williamhawk English 0 Williamhawk [Read]
11 November 2017 à 12:39

Williamhawk, Saturday 11 November 2017 à 12:39 | Quote


Subscription date : 05 October 2017
Messages : 70
Hi,

I have the requirement to connect to TFS GIT repository and TFS version control programatically using c#.

I have used Microsoft.TeamFoundation.Client.dll and Microsoft.TeamFoundation.VersionControl.Client.dll to connect to tfs and able to perform check-in and check-outs.

Now when trying to connect to TFS GIt repository using the code below is throwing error.

Microsoft.VisualStudio.Services.Common.WindowsCredential wCred = new Microsoft.VisualStudio.Services.Common.WindowsCredential(credentials);
VssCredentials cred = new VssCredentials(wCred);
tpc = new TfsTeamProjectCollection(new Uri("http://x.x.x.x:8080/tfs/defaultcollection"), cred); Microsoft.TeamFoundation.Git.Client.GitRepositoryService rep = new GitRepositoryService();
rep.Initialize(tpc); // This line gives the error
Error:

An exception of type 'System.IO.FileLoadException' occurred in Microsoft.VisualStudio.Services.WebApi.dll but was not handled in user code

Additional information: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).

Any idea why this error is occuring and also is there any other way to connect to TFS GIT respository using c# other than using GetRepositoryService?

Thank You!!!

I didn't find the right solution from the Internet.
References
https://social.msdn.microsoft.com/Forums/en-US/7376c0ba-bffe-40e3-a08a-ede76d41d55c/error-connecting-to-tfs-git-repository-using-c?forum=tfsgeneral
whiteboard explainer video

Git Version | Version Git

Subjects Author Language Messages Last message
Error connecting to TFS GIT repository using c#
Williamhawk English 0 Williamhawk [Read]
11 November 2017 à 12:39

Post a message

Anti-spam filter 3 (*) times (*) 8 =
            
Did you know ? The Mail tag encrypt the email address to protect you from spam


Glx-Dock / Cairo-Dock List of forums Git Version | Version Git Error connecting to TFS GIT repository using c# Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.