-
Notifications
You must be signed in to change notification settings - Fork 255
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
Basic auth issues with NuGet 3.1.1 in Visual Studio 2015 #1158
Comments
@martinsuchan I assume that this works fine for |
We never had any troubles with older projects using package.config, because we stored all required NuGet packages in our Git repo and the restore feature was not necessary. |
By the way, when adding these packages using NuGet Package manager in VS, the behavior is also a bit strange. I got three NuGet sources in settings - default NuGet, our private feed and the test feed. This is how it looks when adding LibMain specifically from our test feed to project. It makes requests to ALL feeds searching for the package name and does full package restore of all .NET Core packages even when adding package from custom feed with no other dependencies. Not sure, if this is the expected behavior now...
|
Yes this is the expected behavior. Since it doesn't know where the package is supposed to come from, it goes out (in parallel) to all feeds. Suggestion - You want to disable the curated feeds, they are just a duplicate of the main feed and cause extra unnecessary calls. |
@feiling please validate also package.config scenarios against this server |
@yishaigalatzer Since it doesn't know where the package is supposed to come from, it goes out (in parallel) to all feeds. Regarding NuGet Restore in project using package.config, I've just tested it, it works with my private feed using basic authentication. It fails only for the new projects using project.json. |
@martinsuchan Your dependencies might come from other configured feeds. Are all of your packages on the private feed? If yes then why isn't that configured in a solution level nuget.config file? |
It has dependencies on other feeds, but that does not answer the question why it asks for LibMain using all feeds?
|
Sure that could be an optimization but that's not currently how it's implemented. |
@martinsuchan I see your point. it goes a bit beyond optimization, I assume you are expecting that package to only come from the feed you specified. I'm going to try and explain the process here, I hope it makes it clearer what is going on. This process applies only to @davidfowl feel free to edit/correct Install process
Restore process
It is rather complicated to figure out diffs and subgraphs to spend less time on the network, but like @davidfowl says it might be something to look into in the future. Either way - We are going to work on fixing the basic auth issue shortly, and once this bug is closed feel free to ping me, and I can try and share private bits with you. |
I see from your description, that the new package restore mechanism wasn't designed to handle effectively several custom feeds. The package restore should be aware of the source where I selected specific package, but this goes beyond my original problem. For now I'll be happy if I and our TeamCity build server can restore all packages from a clean checkout. |
This has a similar problem with the existing mechanism, ordering doesn't solve the problem it makes it seem like it does. The real answer here, is to namespace the in company packages (or similarly the in team packages, when multiple teams share a internal nuget server). |
…dio 2015. Note that this issue is related to NuGet/Home#941 (Package restore of universal applications does not work with authenticated feeds). It was closed as fixed but the fix misses two scenarios: - The credentials saved in nuget.config is not used. - The Prompt dialog will not pop up again if user gives the wrong credentials.
…dio 2015. Note that this issue is related to NuGet/Home#941 (Package restore of universal applications does not work with authenticated feeds). It was closed as fixed but the fix misses two scenarios: - The credentials saved in nuget.config is not used. - The Prompt dialog will not pop up again if user gives the wrong credentials.
…ange fixes auth in the command line.
…dio 2015. Note that this issue is related to NuGet/Home#941 (Package restore of universal applications does not work with authenticated feeds). It was closed as fixed but the fix misses two scenarios: - The credentials saved in nuget.config is not used. - The Prompt dialog will not pop up again if user gives the wrong credentials.
…ange fixes auth in the command line.
The source is reachable but building takes forever and doesn't finish. Assigning to Fei to take a look |
Hi, I have faced the below issue while install my UWP package from my own private feed. PM> Install-Package
is this issue fixed in 3.3.0.167 NuGet Package manager version? |
Hard to tell from this question, why won't you update to 3.3? |
Mathikp your report seems not related to this issue. Can you please open a new issue and provide a fiddler trace as well as information about the type of private feed you are using and the source you are using? |
Warning: FindPackagesById: NuGet.CommandLine
Response status code does not indicate success: 401 (Unauthorized).
GET http://nugetrepo.misatravel.net/FindPackagesById()?id='NuGet.CommandLine'
GET https://www.nuget.org/api/v2/package/NuGet.CommandLine/3.3.0
Warning: FindPackagesById: NuGet.CommandLine
Response status code does not indicate success: 401 (Unauthorized).
GET http://nugetrepo.misatravel.net/FindPackagesById()?id='NuGet.CommandLine'
Error: FindPackagesById: NuGet.CommandLine
Response status code does not indicate success: 401 (Unauthorized). |
From @martinsuchan
Hi, we're using custom NuGet repository secured by basic authentication and we've also started developing UWP Windows 10 apps that use the new project.json NuGet config file. The problem is that **NuGet 3 is unable to successfully restore
packages because the restore process is ignoring provided basic authentication credentials**.
I've created simple repro available here: http://1drv.ms/1hvdfFT
How to use it:
run the 0_InitCustomSource.ps1 file to add reference to test NuGet server located on
http://nugetbug.azurewebsites.net/nuget -UserName "nugetbug" -Password "bugbug"
The server contains two NuGet pacakges, LibCore and LibMain that depends on LibCore, both for Windows 8.1 apps.
The sample also contains UWP project referencing LibMain.
Expected behavior: when I open the project without project.lock.json, click Rebuild - all packages are properly restored, the build works on first try.
Current behavior: The build fails with this error message:
This currently breaks our build environment and it also makes it hard to impossible to do clean checkout and just build our project, this is basically show-stopper right now.
Possible workaround could be disabling the basic authentication on our NuGet server or caching the project.json.lock in source control, none of which is a good solution.
Tested on Windows 10, VS2015 with Win10 SDK, all RTM, and NuGet package manager 3.1.60724.766.
The text was updated successfully, but these errors were encountered: