开发者

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

开发者 https://www.devze.com 2023-03-05 21:57 出处:网络
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.

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.

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?

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.o开发者_开发百科rg/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".

Edit: Check out this link, has some potential fixes: 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. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消