How to upgrade Ext.NET 5.3 to the latest Newtonsoft.Json release

  1. #1

    How to upgrade Ext.NET 5.3 to the latest Newtonsoft.Json release

    At the time of writing this guide, the Newtonsoft.Json NuGet package version was 13.0.2. One major version ahead of Ext.NET's referenced 12.0.3.

    So, now that there's a major version of the package, must I stick to the old one just because Ext.NET was not built for that?

    Well, not really. Updating the NuGet package to the new version works with current Ext.NET without the need of further do!

    The steps to upgrade the NuGet package are simple and just a few. This can be done by manually editing the project (.csproj) and the packages.json files, or by using Visual Studio's NuGet Packages Manager GUI, which allows for project-by-project or solution-wide management.

    Different approaches of updating NuGet packages in Visual Studio projects are covered by the official Microsoft Visual Studio guide, but if you are in a hurry and using Visual Studio these simple steps might get you up to speed:

    1. Right click the project you want to upgrade the NuGet package from, and choose Manage NuGet Packages...
    Click image for larger version. 

Name:	01-managePackage.png 
Views:	46 
Size:	27.2 KB 
ID:	25595

    The NuGet packages manager should open, and in a while, show some available NuGet packages to assign to your project. That's not really what we want here, we want to be able to upgrade the Newtonsoft.Json package that should already be installed.

    2. Click the Updates tab. It should have a number next indicating how many NuGet packages in the project have found updates.

    Note: if you have Include prerelease (next to the search field) checked, the updates will suggest unstable/prerelease package versions if any newer than current version (or latest stable) are available.

    3. In the list of packages, scroll down to find the Newtonsoft.Json package. In our example, it currently has 12.0.2 installed, and latest (stable) available just happens to be 13.0.2.
    Click image for larger version. 

Name:	02-findNewtonsoftJson.png 
Views:	51 
Size:	74.8 KB 
ID:	25596

    4. Once clicking the NuGet package, the right pane should show further details about the package, as well as a dropdown to allow fine-tuning the version to install. It also tips whether the chosen version is a stable or prerelease one (see figure above).

    You may select another version to upgrade to, or just go with whatever version the GUI suggested.

    5. Click Update next to the version dropdown.

    Visual Studio will perform some checks and present with a change report (this dialog can be disabled so if you once disabled it, VS will just carry on with the update).
    Click image for larger version. 

Name:	03-changesPreview.png 
Views:	42 
Size:	22.0 KB 
ID:	25597

    6. Confirm by clicking OK

    Visual studio will then effectively upgrade the package version and will refresh the GUI, just to reveal Newtonsoft.Json package is no longer there! Of course, if the update was done for the actual latest version.

    Any packages that the Nuget Packages Manager GUI sees new versions for will always be in the Updates tab, but changing (downgrading) a version will always be available from the Installed packages tab.

    Click image for larger version. 

Name:	04-packageUpToDate.png 
Views:	44 
Size:	82.2 KB 
ID:	25598

    It works?

    Now, you should be asking yourself, "but Ext.NET was built for Newtonsoft.Json 12.0.x, why should it work?".

    Long story short, the new version of the package does not introduce (at least to this point) any existing feature change that would break how Ext.NET core packages uses it. Furthermore, Visual Studio employs assembly binding that "consolidates" references versions across different dependecies, allowing such to be done.\

    There's not guarantee though, that at some point, a package would become incompatible with Ext.NET! So exert extra care when upgrading packages. Always test thoroughly before submitting to production!

    Hope this helps!
    Last edited by fabricio.murta; Feb 09, 2023 at 9:49 PM. Reason: add link to "assembly binding" term

Similar Threads

  1. [CLOSED] Newtonsoft.Json 6.0.6.1
    By threewonders in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 05, 2014, 7:42 AM
  2. Replies: 16
    Last Post: Oct 17, 2013, 7:17 PM
  3. NewtonSoft.Json V4.0.5.14411 /w Ext.Net V1.0.xxx.xxx
    By Daniel.Dority in forum 1.x Help
    Replies: 4
    Last Post: Mar 02, 2012, 9:21 AM
  4. [CLOSED] Newtonsoft.json
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 09, 2011, 2:26 PM
  5. [CLOSED] Newtonsoft.Json, "Could not load"
    By pkellner in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Mar 24, 2009, 11:40 PM

Posting Permissions