Downgrade NuGet Packages - Visual Studio

I came across this problem when I was working with the SignalR WebSocket. The project was already included with the references related to SignalR 2 Server application and I wanted to add Newtonsoft.Json library into my project for some json serialization and de-serialization. Added it without a problem, except there was an exception from SignalR. It needed Newtonsoft version 6.0 and adding Newtonsoft again has updated that reference to 9.0 which was the latest update for Newtonsoft. So following is the solution I used for downgrade Newtonsoft.Json back to version 6.0.

1. First you should get the Package Manager Console Window. It is reachable via "TOOLS -> Library Package Manager -> Package Manager Console".




2. Then you have to uninstall the current version of the library you want to downgrade, by executing the following command in the Package Manager Console. It's very important you use the -Force flag, if there are dependencies to the package you're trying to downgrade. If there are dependencies (In my case there were dependencies from SignalR references), without the -Force flag uninstalling will fail.

PM>Uninstall-Package <Package you want to uninstall> -Force

In my case,
PM>Uninstall-Package Newtonsoft.Json -Force


3. At last you can reinstall the same package with the old version you want. To do that you can execute the following command in the Package Manager Console. To auto complete the available version numbers you can press the tab key when the cursor is placed after the -Version flag.

Install-Package <Package you want to uninstall> -Version <Version Number>

In my case,
Install-Package Newtonsoft.Json -Version 6.0.2

Now you have completed downgrading your Nuget Package.

Hope this helps someone, making things work easy.
Thanks.

Comments

  1. Downgrade Nuget Packages - Visual Studio >>>>> Download Now

    >>>>> Download Full

    Downgrade Nuget Packages - Visual Studio >>>>> Download LINK

    >>>>> Download Now

    Downgrade Nuget Packages - Visual Studio >>>>> Download Full

    >>>>> Download LINK N4

    ReplyDelete

Post a Comment

Popular posts from this blog

WPF Dispatcher - Accessing UI Thread From Another Thread

Callbacks With Interfaces Or Delegates