简体   繁体   English

使用NuGet安装软件包会连接到TFS并显示401错误

[英]Installing a package with NuGet connects to TFS and gives a 401 error

My solution in Visual Studio 2010 is under TFS source control. 我在Visual Studio 2010中的解决方案受TFS源代码控制。 When I open the NuGet UI and try to install a new package, I get an HTTP 401 Unauthorized error. 当我打开NuGet UI并尝试安装新程序包时,出现HTTP 401未经授权错误。

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). 如果我同时运行Fiddler,则可以看到NuGet正在尝试连接到我的TFS服务器(而不是大概的NuGet服务器)。

What exactly is going on here, and what do I have to do in order to install a package? 这到底是怎么回事,我必须做什么才能安装软件包?

UPDATE: 更新:

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? 它发送到服务器的请求是什么?

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". 我认为NuGet中没有任何东西可以自动连接到其他服务器,但是您可以在Visual Studio中的“工具”->“库软件包管理器”->“软件包管理器设置”下,查看/配置它检查的服务器(以及检查顺序)。 “包来源”。

Edit : Check out this link, has some potential fixes: http://nuget.codeplex.com/discussions/246381 编辑 :检查此链接,有一些潜在的解决方法: http : //nuget.codeplex.com/discussions/246381

I find that I have to restart visual studio after each package I install from NuGet when working with TFS as I get errors around accessing the collection and can't add further packages, check-in and it screws source control bindings. 我发现在使用TFS时,从NuGet安装的每个软件包之后,我都必须重新启动Visual Studio,因为在访问该集合时出现错误,并且无法添加其他软件包,签入并破坏了源代码控制绑定。 After restarting all seems to work okay - don't know if this is just NuGet and TFS not being tested well together or just how it is set up on our network but TFS doesn't seem the greatest source control solution to use when using NuGet. 重新启动后,一切似乎都可以正常工作-不知道这仅仅是NuGet和TFS不能一起很好地测试,还是不知道如何在我们的网络上对其进行设置,但是TFS似乎不是使用NuGet时使用的最大源代码控制解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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