本文介绍了使用 NuGet 安装包连接到 TFS 并给出 401 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 2010 中的解决方案受 TFS 源代码控制.当我打开 NuGet UI 并尝试安装新包时,我收到 HTTP 401 Unauthorized 错误.

My solution in Visual Studio 2010 is under TFS source control. When I open the NuGet UI and try to install a new package, I get an HTTP 401 Unauthorized error.

如果我同时运行 Fiddler,我可以看到 NuGet 正在尝试连接到我的 TFS 服务器(而不是 NuGet 服务器).

If I run Fiddler at the same time, I can see NuGet is trying to connect to my TFS server (instead of, presumably, the NuGet server).

这里到底发生了什么,我必须做什么才能安装软件包?

What exactly is going on here, and what do I have to do in order to install a package?

更新:

当我单击安装"按钮时,将发送以下消息:

The following message is being sent when I click the "Install" button:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns="http://schemas.microsoft.com/TeamFoundation/2005/06/VersionControl/ClientServices/03"
               xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
        <GetRepositoryProperties/>
    </soap:Body>
</soap:Envelope>

推荐答案

它发送到服务器的请求是什么?

What's the request it's sending to the server?

我认为 NuGet 中没有任何东西可以自动连接到不同的服务器,但是您可以在 Visual Studio 中的 Tools -> Library Package Manager -> Package Manager 下查看/配置它检查的服务器(以及按哪个顺序)然后在包来源"下进行设置.

I don't think there's anything in NuGet to automatically connect to a different server, but you can see/configure which servers it checks (and in which order) in Visual Studio under Tools -> Library Package Manager -> Package Manager Settings then under "Package Source".

编辑:查看此链接,有一些潜在的修复:http://nuget.codeplex.com/discussions/246381

Edit: Check out this link, has some potential fixes: http://nuget.codeplex.com/discussions/246381

这篇关于使用 NuGet 安装包连接到 TFS 并给出 401 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 09:55