Is there a way to download a previous version of a package with NuGet, not the latest one?
8 Answers
Bring up the Package Manager Console in Visual Studio - it's in Tools / NuGet Package Manager / Package Manager Console. Then run the Install-Package command:
Install-Package Common.Logging -Version 1.2.0
See the command reference for details.
Edit:
In order to list versions of a package you can use the Get-Package command with the remote argument and a filter:
Get-Package -ListAvailable -Filter Common.Logging -AllVersions
By pressing tab after the version option in the Install-Package
command, you get a list of the latest available versions.

- 19,693
- 20
- 69
- 84

- 29,411
- 6
- 59
- 81
-
1Explicitly getting a list of available packages: follow @Maciek 's response. You should also notice that when typing a space after the -Version argument, the NuGet Console in VS will show you some autocomplete list with the available versions for that package. – Xavier Decoster Jul 07 '11 at 21:02
-
20This command should also be available via the UI. Now if a publisher has a beta version, you can only get that latest version, which is sometimes unstable. – Bart Verkoeijen Feb 12 '12 at 10:27
-
56For the benefit of those who have been using Nuget for a while but never done anything with it from the command line: To run the powershell commands that PHeiberg mentions you will want to bring up the Package Manager Console in Visual Studio - it's in **Tools|Library Package Manager|Package Manager Console**. – Jonathan Moffatt Oct 11 '11 at 23:54
-
OR **View | Other Windows | Package Manager Console** =] – Leniel Maccaferri Feb 02 '12 at 15:46
-
2@bgever - Most publishers create *Prereleases* for beta packages which are not considered the "Latest" in the GUI. As long as the publisher uses versioning correctly, the latest version should always be a stable one. That doesn't mean it won't have bugs however... – Jesse Webb Jan 04 '13 at 20:14
-
3Dependency info and examining what other properties are available: Get-Package -ListAvailable [-Source X] -Filter Common.Logging -AllVersions **| select version, dependencies** (or '**| get-member**' to see all the properties) – Curtis Yallop Jan 25 '13 at 21:49
-
2`Get-Package -ListAvailable` does **not** list all available versions for me. – Roman Starkov Jun 26 '14 at 15:15
-
2The `ListAvailable` argument in the `Get-Package` command has been deprecated. You should use `Find-Package
-AllVersions` instead – Joseph Guadagno Jul 26 '16 at 21:41 -
@makhdumi : For big projects I only install packages from a local packages mirror. To add a package I open a small visual studio project and only install it there first . From the small project I copy the package to the local packages mirror and then update it in the bigger project. – Gregor Dec 08 '21 at 04:05
Browse to its page in the package index, eg. http://www.nuget.org/packages/Newtonsoft.Json/4.0.5
Then follow the install instructions given:
Install-Package Newtonsoft.Json -Version 4.0.5
Alternatively to download the .nupkg
file, follow the 'Download' link eg. https://www.nuget.org/api/v2/package/Newtonsoft.Json/4.0.5
Obsolete: install my Chrome extension Nutake which inserts a download link.

- 132,665
- 89
- 401
- 465
Another option is to change the version number in the packages.config
file. This will cause NuGet to download the dlls for that version the next time you build.

- 19,002
- 22
- 69
- 94
-
1Nice one... didn't think about that. I guess [NuGet Package Restore](https://docs.nuget.org/docs/reference/package-restore) has to be enabled for the solution though. – Leniel Maccaferri Apr 19 '14 at 18:10
-
12This isn't enough to also change the assembly reference automagically. What works though (if you have at lease two assemblies in your solution) is this: 1. make sure one assembly references the package, 2. edit the correct version in `packages.config`, 3. manage the NuGet packages on the solution, 3a. add the package to another project, removing it from the original project, and confirm this, 3b. reverse 3a and confirm. Step 3a will add the correct assembly reference to another project and remove it from the original. Step 3b will add the correct assembly reference to the original project. – Jeroen Wiert Pluimers May 23 '14 at 08:12

- 8,791
- 2
- 32
- 41
-
1Nice when it works but I've seen cases where not all old versions are listed there. – StayOnTarget Jan 15 '20 at 19:32
In NuGet 3.0 the Get-Package
command is deprecated and replaced with Find-Package
command.
Find-Package Common.Logging -AllVersions
See the NuGet command reference docs for details.
This is the message shown if you try to use Get-Package in Visual Studio 2015.
This Command/Parameter combination has been deprecated and will be removed
in the next release. Please consider using the new command that replaces it:
'Find-Package [-Id] -AllVersions'
Or as @Yishai said, you can use the version number dropdown in the NuGet screen in Visual Studio.

- 6,977
- 1
- 28
- 35
As the original question does not state which NuGet frontend should be used, I would like to mention that NuGet 3.5 adds support for updating to a specific version via the command line client (which works for downgrades, too):
NuGet.exe update Common.Logging -Version 1.2.0

- 3,321
- 1
- 29
- 41
I landed on this page but my requirement is different, I wanted to download old version of .nupkg file instead of downloading from VS2019 - to get old version of .nupkg
- Go to nuget.org
- Search package ex: Newton Json
- Click on result package name
- Click on Versions tab and download the version you want

- 1,154
- 1
- 9
- 21
By using the Nuget Package Manager UI as mentioned above it helps to uninstall the nuget package first. I always have problems when going back on a nuget package version if I don't uninstall first. Some references are not cleaned properly. So I suggest the following workflow when installing an old nuget package through the Nuget Package Manager:
- Selected your nuget server / source
- Find and select the nuget package your want to install an older version
- Uninstall current version
- Click on the install drop-down > Select older version > Click Install
Good Luck :)

- 268
- 1
- 9