5

I am using LINQPad 5 and VSTS (visual studio team services) I have a NuGet feed (v3) in VSTS and I would like to use packages from there(private) in LINQPad

I have tried using the personal access token from VSTS as the NuGet password in LINQPad I have tried putting the VSTS credential provider for nuget in AppData\Local\NuGet\CredentialProviders
I have tried putting the VSTS credential provider for nuget in AppData\Local\LINQPad\NuGet\CredentialProviders
I have tried using my VSTS username and password as the nuget credentials

How is this done? Is there a bug in LINQPad? Is this not supported yet?

Community
  • 1
  • 1
Arch
  • 1,439
  • 1
  • 10
  • 16
  • LINQPad supports only standard NuGet authentication right now, so a personal access token should be the solution. I don't have a VSTS feed to test, so I cannot say why this doesn't work. Can you test your personal access token in another way, say from the NuGet command-line from a machine without the NuGet VSTS Credential Provider installed? – Joe Albahari Nov 11 '16 at 04:32
  • 1
    I got it to work using the token as the username and a blank password. My mistake was using the token as a password – Arch Nov 14 '16 at 18:16
  • Actually maybe it's not working as the username, it might be getting cached from the manual nuget.exe run – Arch Nov 14 '16 at 19:25

3 Answers3

12

We managed to get it to work by using the v2 nuget API:

/nuget/v2

instead of:

/nuget/v3/index.json

Just put the personal access token in the password text box on LINQPad Package Sources dialog box.

Unheilig
  • 16,196
  • 193
  • 68
  • 98
Eric
  • 136
  • 2
  • 3
  • 3
    This doesn't appear to work, or at least only partially works. I have a feed with > 300 packages, but the v2 index only returns a single package. If I change feeds and change back, it then throws a TF400813 "Resource not available for anonymous access" – EKW Apr 20 '17 at 15:20
  • 1
    Did not work for me neither. "TF400813: Resource not available for anonymous access. Client authentication required." – Eugene D. Gubenkov Dec 28 '17 at 11:27
  • Here is what works: Generate Personal Access Token (googlable) then you can stick in both username and password fields in the LinqPad settings. – Eugene D. Gubenkov Jul 24 '19 at 13:28
1

My current way of getting it to work is as follows:

  • use nuget v2 feed https://<instance>.pkgs.visualstudio.com/_packaging/<feed>/nuget/v2
  • put the personal access token in the password text box
    • make sure the access token is still valid...
  • restart linqpad when in doubt! It seems to cache some old credentials (e.g. expired PAT) sometimes
  • try disabling other feeds so you only have one feed enabled
  • this helps sometimes: under advanced, enable use legacy search engine (v2)
Alex AIT
  • 17,361
  • 3
  • 36
  • 73
0

i'm using a v3 feed in linqpad v6 following the format https://pkgs.dev.azure.com/XXXXX/_packaging/FEED/nuget/v3/index.json

the only way i got it to work was using the PAT (having Packaging Read access) as the username, empty password. @joe-albahari's instructions on the forums and such to use the PAT it in the password field did not work.

MrTristan
  • 739
  • 5
  • 17