NuGet / NuGet/Home

dotnet add package --source uses the default sources as well

Open
#6,232 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Category:Quality Week Priority:2 Product:dotnet.exe Style:PackageReference Type:Bug
Dominant language
HTML
Stars
1.6k
Forks
276
Avg merge
6d 1h
Merged PRs (30d)
1

Description

In my global NuGet.Config (in user's profile) I have several sources configured.

Then in a project I'm adding a new package:

dotnet add package MyPackage --source https://company/api/nuget/nuget-virtual 

This package exists in several sources from the global NuGet.Config.
NuGet uses them all, finds a most recent version and adds PackageReference.
Problem is that it totally ignores my argument --source where I ask to use a particular source instead of all sources from global config.

If it's ignored then why does it exist and documented?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the command with a global NuGet.Config containing multiple sources, then compare package selection when --source is supplied with the documented behavior. Trace the dotnet add package source-selection entry point and its tests; done means the specified source is either used exclusively or the documented behavior is corrected.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.