NuGet 套件管理員預設就有兩個可用套件來源:
1. nuget.org 2. Microsoft Visual Studio Offline Packages
當我想新增 Azure Artifacts 的 NuGet feed 到這裡來,預設會新增到最後一個位置。
但是當我想移動套件來源的順序時,就算我調整到最上面 (第一順位) 並按下確定,下次再開啟套件來源的選項設定,會看到自定的套件來源還是出現在最後一個位置,不能依照我所設定的調整到第一順位。
這算是 Bug 嗎?
_This issue has been moved from https://developercommunity.visualstudio.com/content/problem/614163/在-nuget-套件管理員新增套件來源無法調整順序.html
VSTS ticketId: 934339_
_These are the original issue comments:_
Jane Wu [MSFT] on 6/19/2019, 07:59 PM (19 days ago):
Translated from Bing:
The NuGet Suite Administrator Preset has two available kit sources:
1. nuget.org 2. Microsoft Visual Studio Offline Packages
When I want to add Azure Artifacts' NuGet feed here, the default will be added to the last location.But when I want to move the order of the kit source, even if I adjust to the top (first order) and press OK, the next time I open the option settings of the kit source, I will see that the custom kit source still appears in the last one. Position, can not be adjusted to the first order according to my settings.
Is this a bug?
Visual Studio Feedback System on 6/19/2019, 08:23 PM (19 days ago):
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
_These are the original issue solutions:_
(no solutions)
The arrow keys in the PM sources UI add no value, since they do not modify the configs.
Furthermore the ordering of the sources does not affect any nuget operations whatsoever.
//cc @karann-msft useful feedback about the redesign of the settings UI.
Users expressed confusion and actually wanted to control the order here:
https://github.com/NuGet/Home/issues/3676
Yet another confused customer from: https://github.com/NuGet/Home/issues/8315
I think we should remove the arrows in the near term and track the redesign in #7973.
See reasoning here: https://github.com/NuGet/Home/issues/9653#issuecomment-639961064
Copying the most important things.
Why not make them change the order?
Lots of input for that here #3676
2 reasons
I want to call attention to the specific response the NuGet team gave in the issue you linked https://github.com/NuGet/Home/issues/3676#issuecomment-254570021.
The customer interpreta priority that does not exist. The only source preference that's existed is packages.config, the selected source was treated as a primary source and that's the one that'd be use to obtain the package when necessary.
That priority never manifest in the package source options dialog.
In this particular issue a customer wants the arrows to control the persistence order of the sources. So we have examples of 2 different customers misinterpreting the arrows.
The complexity with this particular aspect is something I described in the above issue:
This is even more of a problem when you can account for the fact that NuGet configs are merged, so sources could be coming from different configs.
What happens when you move a source lower, in a range of sources defined in a different file. Do you move the declaration from one nuget.config file to another? Is that obvious to the customer?
My conclusion from it all, the arrows add no obvious value to the topic and are ambigious.
The current UI as is, does not provide sufficient enough detail to implement such a functionality.
7973 - I would call this "a bulleted list of relatively broad UI config concepts". Do we have anything solidified, any mockups?
Given the cascading behavior of NuGet.config, the current UI is obviously lacking and in need of a refresh. #7973 is used to track the requirements.
Given the number of people that have been confused by the arrows, I think we should remove them. It's cheap to do and eliminates unnecessary confusion.
Another confusion by the existence of arrow keys. Customer expected priority: https://developercommunity.visualstudio.com/content/problem/1063077/cannot-installrestore-nuget-packages-via-manage-nu.html?childToView=1086813#comment-1086813
Triage:
We will remove the arrows in the meantime because they cause confusion for our customers.
And yet another confused customer (me :P): https://developercommunity.visualstudio.com/comments/1101169/view.html
The order of the NuGet sources does affect functionality in at least one place: When installing NuGet packages via the Visual Studio UI.
Right click on a project and go to Manage NuGet Packages. At the top right of the window, there's a "Package source" dropdown. The order of the packages in this dropdown are in the same order as when configuring NuGet sources.
Importantly, when installing a new package, VS defaults the value in the "Package source" dropdown to be the first NuGet source that's listed when configuring NuGet sources.
Let's say that I have two NuGet sources:
By default, whenever installing a new package via the Visual Studio UI, Visual Studio first looks only in source_that_only_works_on_company_network. I want it to look in nuget.org by default, but there's no easy way to accomplish this, since the NuGet sources reordering UI doesn't work :P
@Bosch-Eli-Black
Right click on a project and go to Manage NuGet Packages. At the top right of the window, there's a "Package source" dropdown. The order of the packages in this dropdown are in the same order as when configuring NuGet sources.
Importantly, when installing a new package, VS defaults the value in the "Package source" dropdown to be the first NuGet source that's listed when configuring NuGet sources.
NuGet defaults to all the first time. After that it just goes to whatever the user selected. Meaning, you can select pretty much any source.
By default, whenever installing a new package via the Visual Studio UI, Visual Studio first looks only in source_that_only_works_on_company_network. I want it to look in nuget.org by default, but there's no easy way to accomplish this, since the NuGet sources reordering UI doesn't work :P
This is not true in PackageReference. PackageReference treats all feeds in an equivalent way.
In packages.config install/update, the selected feed is treated as a primary, while the others are treated as secondary sources. What that means is that the selected packages is download from the selected feed, but the transitive packages can be download from all the feeds.
So the behavior here is unaffected by the arrows. It's all about the user selection.
Ah, got it; thanks, @nkolev92 :)
As part of this work, let's also update the Add/Remove icons. They look a couple decades old (I think these are Windows Forms assets)
