-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for authenticated package sources #24
Comments
(while updating NuGet package references for a project) #24
(while updating NuGet package references for a project) tintoy/msbuild-project-tools-server#24
@tintoy thank all for all of your work on this useful extension. Do you have any idea when you might find the time to finish and merge this feature? |
Hi :) Sorry, I'd completely forgotten about this issue - I'll take a look tomorrow and see what I can do. |
Hi. I've built a preview version of the extension with this functionality; can you try installing it from the VSIX package below and see if it works for you? You'll need to uninstall the existing extension first if you installed it from the gallery. |
Thank you. I installed the preview build and now there aren't any exceptions related to authentication, however I do get this one:
My sources are (redacted DevOps project name):
Both trigger the same exception when isolated in NuGet.config. So it seems there is something different about Azure DevOps Artifacts repositories. One suggestion would be to catch the exception and skip the offending source, as this also breaks nuget.org completion. However a true fix would be ideal, if you have any ideas what the reason here could be. |
It sounds like Azure DevOps package repositories don’t fully implement the v3 protocol (e.g. the search facility). I imagine that their main use case could be installing packages with known Ids not finding package Ids by partial match…? I think we can have it skip Azure DevOps sources (or have a setting representing a list of package sources never to offer completion from). Will see what I can do 🙂 |
(part of the v3 protocol is discovery of endpoints within the API and their functionality - if the client library is throwing that exception it means that the search endpoint is not present) |
Not really - those source work normally in Visual Studio's Package Manager, with search and all. Maybe check how the requests differ between VS and NuGet client libraries with Fiddler? Although I would think they share code. |
Interesting - they don’t seem to play nice with the offical NuGet client libraries though. Well, the version I’m using anyway. I’ll try with the latest version later this morning - I wouldn’t be surprised if they have special-case code in there somewhere. |
Can you try creating a .net core console project with this code and running it? https://gist.github.com/tintoy/3d9467d59b2547ad227ba5d1560ee838 I figure that may save us a bunch of time figuring out what the exact error you're seeing really is. |
Never mind - it turns out that was a complete waste of time: 😂😂😂 |
Ok - this might help: https://gist.github.com/tintoy/3d9467d59b2547ad227ba5d1560ee838#file-program-cs-L105 |
Not much more output, am I missing some logging configuration?
That's from dotnet run after downloading the entire gist as zip and copying NuGet.config over. |
Hmm - that cache business is interesting. I think, for now, I’ll add a package source ignore list to the extension settings so at least you won’t be blocked entirely and then do some experimentation around upgrading the NuGet client libraries when I get some time (experience has taught me that these upgrades don’t always go smoothly). |
Ok, can you try updating Program.cs from the gist linked above? I've modified it to dump out the service index for each configured package source (this will tell us what capabilities the package source has; the service we need is
|
…urces that don't support the NuGet completion API #24
…urces that don't support the NuGet completion API tintoy/msbuild-project-tools-server#24
…urces that don't support the NuGet completion API #24
…urces that don't support the NuGet completion API tintoy/msbuild-project-tools-server#24
I've also created a preview version of the extension supports both manually and automatically ignoring configured package sources (if you have time, could you try it out and let me know if it works for you?). To manually ignore a package source, use the extension's new |
Here's the output of the updated gist, hope it helps:
By the way, this feed is public, so you can test on your end too. I'm happy to help, don't get me wrong, but it might speed things up for you :) With the new preview I get no suggestions and no errors/messages at all... Output only shows:
|
Thanks for trying that - it looks like they don’t support the auto-complete API (the NuGet client library has a facility for looking up API end-points and out of the ones listed the SearchCompletion service is notably absent). I didn’t realise that feed was public, I’ll try some more tests with it later today and see what I can find. BTW, if you set the extension’s logging level to Verbose you should see log messages about validating and configuring package sources. |
Oh, and there seem to be 2 output window panes called Here's what mine says now that I also have the Azure SDK feed in
Unfortunately Azure DevOps package feeds don't seem to support any version of the |
Ok, have figured out why there were no suggestions. Will at least publish a version of the extension in the meanwhile with support for authenticated package feeds (but still won't work for Azure DevOps feeds at this stage because they don't currently implement the part of the NuGet protocol that we need for this). |
Implemented in v0.4.0. (sorry, still doesn't work with Azure DevOps package feeds but that's a separate issue; I'll keep thinking about that one) |
Needs latest (v5)
NuGet.Client
libraries and configuration for NuGet'sICredentialService
.Relates to tintoy/msbuild-project-tools-vscode#39 and #11.
The text was updated successfully, but these errors were encountered: