Julian
Julian

Reputation: 20324

Can you specify a source for "nuget.exe update -self"?

Running nuget from the command line, you can specify which source(s) to look in when installing or updating packages.

-Source +: A list of package sources to search for updates.

The update command also has a self option:

-Self: Update the running NuGet.exe to the newest version available from the server.

Combining these two however doesn't seem to have any effect: it is always https://nuget.org/api/v2/ that is checked for an update to nuget itself.

We would like to use the self-updating feature of nuget, but at the same time also have control over which versions are available inside our organization (to only allow versions we have approved, e.g. to avoid updating to a version containing a known bug). Is it possible to specify the source for where to look for updated versions of NuGet.exe?

Upvotes: 0

Views: 377

Answers (1)

Matt Ward
Matt Ward

Reputation: 47987

The only way to do this currently would be to build your own version of NuGet.exe.

If you look in the NuGet source code at the SelfUpdater class you will see that it always uses the main NuGet feed https://www.nuget.org/api/v2/ by default when checking for updated versions of NuGet.exe.

Upvotes: 1

Related Questions