简体   繁体   中英

Connecting to a Team Foundation Server in Visual Studio 2015 with C#?

I'm trying to connect some C# code to a Microsoft TeamFoundation Server, but I can't seem to find any documentation for Visual Studio 2015 (Typical Microsoft?) But I did find something for Microsoft Visual Studio 2013. ( https://msdn.microsoft.com/en-us/library/bb286958 )

It turns out that they have broken the old way (2013 way) by removing the Microsoft.TeamFoundation.Framework import, so their example code, using Microsoft.TeamFoundation.Framework.Client; won't work :(

Now they still have some of the old libraries needed, like Microsoft.TeamFoundation.Client found in C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer

[See Where can I find Microsoft.TeamFoundation.Build.Client in Visual Studio 2015? ]

and they have a "2015 .NET Libraries download" thing from 'NuGet' (mentioned in above link) but.. It doesn't contain the needed library, Microsoft.TeamFoundation.Framework !


...So my question is, does anyone have any information on the "new and improved" way to connect to this? I would try creating the project as a Team project, to see if it has some sort of setting built-in, but sadly I think that is out of the question, as I do not have access to create new team projects in Visual Studio online.

There are now a series of nuget packages for TFS and VSTS.

The traditional object model can be found in the Microsoft.TeamFoundationServer.ExtendedClient pacakge.

There are other packages for the REST API, Account Details and Interactive sign-in.

The following description of the packages comes from this blog post :


  • Microsoft.TeamFoundationServer.ExtendedClient This package contains the traditional TFS/VSO client object model that uses the SOAP API. You will need it to get full access to the work item tracking object model, version control, test management, and more. If you've used the TFS/VSO client object model in applications before, this is the one you've used. Because not every API is available in TFS 2015 or VSO currently as a REST API, there are going to be cases where you must use this package. Similarly, there are new features that have been built with only REST APIs for which you will need the Client package.
  • Microsoft.TeamFoundationServer.Client Here you'll find convenient .NET wrappers for our REST APIs for build, team rooms, version control, test case management, and work item tracking. You can of course call the REST APIs directly without using this library. You will encounter cases where an API is not available in this package and have to also use the ExtendedClient package.
  • Microsoft.VisualStudio.Services.Client If you need to access account, profile, identity, security, or other core platform services, you'll need this package.
  • Microsoft.VisualStudio.Services.InteractiveClient This package provides the library necessary to show a user an interactive prompt for credentials to sign in. If you are using basic authentication, personal access tokens, or OAuth, you won't need this.

You can see the relationships here: 包关系

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM