Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I install an older version of a package via NuGet?

I want to install an older version of a package (Newtonsoft.Json). But NuGet rolls back:

PM> Install-Package Newtonsoft.Json -Version 4.0.5 Successfully installed 'Newtonsoft.Json 4.0.5'. Install failed. Rolling back... Install-Package : Already referencing a newer version of 'Newtonsoft.Json'. 

How can I do it?

like image 632
Nebide Yildiz Avatar asked Apr 18 '12 08:04

Nebide Yildiz


People also ask

How do I change NuGet package version?

Right-click the Packages folder in the project, and select Update. This will update the NuGet package to the latest version. You can double-click the Add packages and choose the specific version.

How do I install a NuGet package in Visual Studio 2013?

Add The NuGet Package to you ProjectRight-click on the project's References and click Manage NuGet Packages. In the NuGet Package Manager, select online from the menu and search “New NuGet Package” and click Install.


1 Answers

Try the following:

Uninstall-Package Newtonsoft.Json -Force 

Followed by:

Install-Package Newtonsoft.Json -Version <press tab key for autocomplete> 
like image 180
Xavier Decoster Avatar answered Sep 19 '22 14:09

Xavier Decoster