5

I'm attempting to connect to TFS Preview from a C# application.

At the moment, I'm stuck trying to authenticate. I've added a reference to the TFS 2010 DLLs (I believe that these will enable me to connect, please correct me if I am wrong!) and my test case is as simple as. The URL I am trying to connect to is in the form https://MYSERVERNAME.tfspreview.com/DefaultCollection

var teamProjectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(workPath, new UICredentialsProvider());
teamProjectCollection.EnsureAuthenticated();

This fails with the following exception.

Team Foundation services are not available from server https://MYSERVER.tfspreview.com/$/defaultcollection. Technical information (for administrator): TF400813: Resource not available for anonymous access. Client authentication required.

I had hoped that providing a UICredentialsProvider in the factory method creating the team project collection that it'd use this to provide authentication. The TFS Preview service uses Windows Live authentication, but I had hoped that this would be covered.

Pointers in the right direction greatly appreciated!

4

2 回答 2

2

我发现您无法使用 TFS2010 DLL 连接到 TFSPreview,这很可能是因为需要提供 Web 凭据才能访问该站点。

通过添加对 TFS2012 DLL(随 Visual Studio 2012 RC 一起提供%PROGRAMFILESX86\Microsoft Visual Studio 11.0\Common7\IDE\ReferenceAssemblies\v2.0)的引用,我能够成功连接。

于 2012-07-24T08:36:56.017 回答
0

下载并安装Team Foundation Server 2010SP1 的对象模型,然后安装Visual Studio 2010 SP1 Forward Compatibility GDR。尽管此安装程序可能看起来仅适用于 Visual Studio 2010,但如果它是独立安装的,它会很高兴地更新您的对象模型安装。

于 2012-12-10T19:18:48.177 回答