Skip to content

Nuget.exe sources add does not work if nuget.config does not have proper section #1589

Closed
@bigcat8828

Description

The sources add command does not add the package source into the nuget config if the nuget.config doesn’t already have both a element and an existing package source. The command output of sources add is "package sources added successfully", while there is no package source added at all.

How to repo:

  1. Change the nuget.config to only including following
    <?xml version="1.0" encoding="utf-8"?> <configuration />
  2. Run nuget.exe Sources add -name {sourceName} -source {source}
    3.The output is "Package Source with Name: {sourceName} added successfully."
    4.Check nuget.config, no source has been added at all.

This bug is that nuget.exe fails to add the package source, while claims it added successfully.

Activity

added this to the Client-VNext milestone on Oct 16, 2015
added
Priority:3Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
on Oct 16, 2015
yishaigalatzer

yishaigalatzer commented on Oct 16, 2015

@yishaigalatzer

Thanks for reporting it, for the completeness of this report, what version of nuget.exe are you using.

bigcat8828

bigcat8828 commented on Oct 16, 2015

@bigcat8828
Author

This happens in both nuget 2.8 and 3.x

modified the milestone: Client-VNext on Apr 19, 2016
leasunhy

leasunhy commented on Jun 9, 2017

@leasunhy

Also, if no config file is present when one tries to add a package source, the adding will fail.
Running nuget sources before adding the source will ensure the existence of the config file to make sure the package source is added.
Version: 3.5.0.1938

modified the milestones: Future-2, Backlog on Nov 10, 2017

4 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:3Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.Product:NuGet.exeNuGet.exeTriage:InvestigateType:Bug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Nuget.exe sources add does not work if nuget.config does not have proper section · Issue #1589 · NuGet/Home