1

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.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>
Graham Clark
  • 12,886
  • 8
  • 50
  • 82

2 Answers2

0

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

Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275
  • I've updated my question to show the request message. The only thing in my "Package Source" list is the official NuGet source. – Graham Clark May 13 '11 at 08:00
  • I added a link to my answer which has a little info on this that might help. – Danny Tuppeny May 13 '11 at 08:22
  • splendid, I just renamed the `NuGet.TeamFoundationServer.dll` file in the NuGet dir under Visual Studio, restarted VS2010, then all worked fine. I think our TFS is set up a bit strange, but at least now I can install packages until it gets sorted. – Graham Clark May 13 '11 at 08:39
0

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.

Mark
  • 880
  • 8
  • 18
  • 1
    Recommend you have a look at this post http://stackoverflow.com/questions/6672516/tf30063-you-are-not-authorized-to-access-collection-nuget-and-tfs-conflicting, solved it for me. – SouthShoreAK Apr 02 '12 at 15:54