You don't need to use JsonConverterAttribute, just keep your model clean and use CustomCreationConverter instead, the code is simpler:

Copypublic class SampleConverter : CustomCreationConverter<ISample>
{
    public override ISample Create(Type objectType)
    {
        return new Sample();
    }
}

Then:

Copyvar sz = JsonConvert.SerializeObject( sampleGroupInstance );
JsonConvert.DeserializeObject<SampleGroup>( sz, new SampleConverter());

Documentation: Deserialize with CustomCreationConverter

Answer from cuongle on Stack Overflow
🌐
Newtonsoft
newtonsoft.com › json › help › html › serializingjson.htm
Serializing and Deserializing JSON
For simple scenarios where you want to convert to and from a JSON string, the SerializeObject and DeserializeObject methods on JsonConvert provide an easy-to-use wrapper over JsonSerializer.
Discussions

Should you still use Newtonsoft.Json for new projects over System.Text.Json in aspcore 3.1?
I would say it's a combination of personal preference and whether or not some feature you need is missing in one but present in the other. Personally, I continue to use Newtonsoft.Json, mainly because I'm familiar with it and it does what I need. Any performance improvements in System.Text.Json are negligible for my needs. If Json handling was a performance bottleneck, I might dig deeper, but it's not for me. More on reddit.com
🌐 r/dotnet
63
96
August 10, 2020
Serializing and Deserializing JSON with NewtonSoft (JSON.NET)
What year is it? More on reddit.com
🌐 r/csharp
8
0
June 9, 2022
Newtonsoft.Json vs System.Text.Json vs Json.Net

We are forcing ourselves to use System.Text.Json where we can, not sure we have noticed major performance increases. However, there have been several compatibility issues, where the defaults provided by Newtonsoft were not supported by System.Text.Json at the time.

Once you work through things and increment your api versions to different patterns that support the System.Text.Json use cases everything works great. If I recall the guy who made Newtonsoft started working at MS, not sure if on the json codebase though.

Advantages of Newtonsoft.Json (A.k.a Json.NET)

- Mature

- Lots of configurability

- Wide range support for use cases

Disadvantages of Newtonsoft.Json

- This applies to older packages, but several MS provided packages could never make up their mind about which newtonsoft.Json version to use, and would lock versions making it incompatible with other MS packages.

Advantages of System.Text.Json

- Supposedly new and improved (performance)

- Built into ASP.NET now

- Plug and play in most cases where Newtonsoft was used previously

Disadvantages of System.Text.Json

- Support for complex cases can be difficult to find

- This is big for us, Polymorphic (De)Serialization

- Reference loop handling is weird, newtonsoft was more graceful

More on reddit.com
🌐 r/csharp
42
42
January 26, 2021
🌐
Newtonsoft
newtonsoft.com › json › help › html › serializeobject.htm
Serialize an Object
Account account = new Account { Email = "james@example.com", Active = true, CreatedDate = new DateTime(2013, 1, 20, 0, 0, 0, DateTimeKind.Utc), Roles = new List<string> { "User", "Admin" } }; string json = JsonConvert.SerializeObject(account, Formatting.Indented); // { // "Email": "james@example.com", // "Active": true, // "CreatedDate": "2013-01-20T00:00:00Z", // "Roles": [ // "User", // "Admin" // ] // } Console.WriteLine(json);
🌐
Newtonsoft
newtonsoft.com › json › help › html › serializationguide.htm
Serialization Guide
Opt-in mode for an object is specified by placing the JsonObjectAttribute or DataContractAttribute on the type. Finally, types can be serialized using a fields mode. All fields, both public and private, are serialized and properties are ignored.
🌐
Particular
docs.particular.net › nservicebus › serialization › newtonsoft
Json.NET Serializer • Newtonsoft Serializer • Particular Docs
1 week ago - In contrast to the bundled serializer XContainer and XDocument properties are no longer supported. If XContainer and XDocument properties are required use a JsonConverter as shown below: ... using NewtonsoftJsonSerializer = Newtonsoft.Json.JsonSerializer; class XmlJsonConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, NewtonsoftJsonSerializer serializer) { var xcontainer = (XContainer) value; writer.WriteValue(xcontainer.ToString(SaveOptions.DisableFormatting)); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, NewtonsoftJsonSerializer serializer) { if (reader.TokenType == JsonToken.Null) { return null; } if (reader.TokenType != JsonToken.String) { throw new Exception($"Unexpected token or value when parsing XContainer.
Find elsewhere
🌐
Medium
medium.com › @ieplt › comprehensive-guide-to-using-json-and-newtonsoft-json-in-net-ac67b7963e35
Comprehensive Guide to Using JSON and Newtonsoft.Json in .NET | by İbrahim Emre POLAT | Medium
June 14, 2024 - Serialization is the process of converting an object into a format that can be easily stored or transmitted. Newtonsoft.Json makes it simple to serialize .NET objects into JSON strings.
🌐
Reddit
reddit.com › r/dotnet › should you still use newtonsoft.json for new projects over system.text.json in aspcore 3.1?
r/dotnet on Reddit: Should you still use Newtonsoft.Json for new projects over System.Text.Json in aspcore 3.1?
August 10, 2020 -

Hello Everyone,

You all know that the default JSON serializer has been changed from Newtonsoft.Json to the native System.Text.Json when aspcore 3.0 was first introduced with a better performance and lower memory, so we all know what this means on the long run, it will go for System.Text.Json, but right now it has so many incomplete features compaired to Newtonsoft.Json, so, should you still use Newtonsoft.Json for new projects over System.Text.Json? or you go anyway with System.Text.Json as it's the future?

Thanks all

🌐
C# Corner
c-sharpcorner.com › UploadFile › dacca2 › json-serialization-using-newtonsoft-json-serialize
JSON Serialization Using Newtonsoft JSON Serialize
April 9, 2019 - In this article we will use the Newtonsoft JSON serialization library to serialize JSON data. Download and install the Newtonsoft JSON serializer package using the NuGet package manager.
🌐
Newtonsoft
newtonsoft.com › json › help › html › serializewithjsonserializertofile.htm
Serialize JSON to a file
Movie movie = new Movie { Name = "Bad Boys", Year = 1995 }; // serialize JSON to a string and then write string to a file File.WriteAllText(@"c:\movie.json", JsonConvert.SerializeObject(movie)); // serialize JSON directly to a file using (StreamWriter file = File.CreateText(@"c:\movie.json")) { JsonSerializer serializer = new JsonSerializer(); serializer.Serialize(file, movie); }
🌐
Newtonsoft
newtonsoft.com › json › help › html › serializingcollections.htm
Serializing Collections
To serialize a collection - a generic list, array, dictionary, or your own custom collection - simply call the serializer with the object you want to get JSON for.
🌐
Reddit
reddit.com › r/csharp › serializing and deserializing json with newtonsoft (json.net)
r/csharp on Reddit: Serializing and Deserializing JSON with NewtonSoft (JSON.NET)
June 9, 2022 - Newtonsoft JSON needs to retire. System.Text.Json is the new default. ... Success! Thanks for the sub. Always interested in hearing your feedback 😃 More replies ... Thanks fam, pretty good. ... Trouble wrapping head around JSON serialization and deserialization.
🌐
Reddit
reddit.com › r/csharp › newtonsoft.json vs system.text.json vs json.net
r/csharp on Reddit: Newtonsoft.Json vs System.Text.Json vs Json.Net
January 26, 2021 -

Hello, can anyone explain me the differences between this three libraries ?

Can you expose advantages and disadvantages of them ?

Top answer
1 of 5
36

We are forcing ourselves to use System.Text.Json where we can, not sure we have noticed major performance increases. However, there have been several compatibility issues, where the defaults provided by Newtonsoft were not supported by System.Text.Json at the time.

Once you work through things and increment your api versions to different patterns that support the System.Text.Json use cases everything works great. If I recall the guy who made Newtonsoft started working at MS, not sure if on the json codebase though.

Advantages of Newtonsoft.Json (A.k.a Json.NET)

- Mature

- Lots of configurability

- Wide range support for use cases

Disadvantages of Newtonsoft.Json

- This applies to older packages, but several MS provided packages could never make up their mind about which newtonsoft.Json version to use, and would lock versions making it incompatible with other MS packages.

Advantages of System.Text.Json

- Supposedly new and improved (performance)

- Built into ASP.NET now

- Plug and play in most cases where Newtonsoft was used previously

Disadvantages of System.Text.Json

- Support for complex cases can be difficult to find

- This is big for us, Polymorphic (De)Serialization

- Reference loop handling is weird, newtonsoft was more graceful

2 of 5
14

json.net is just another name for newtonsoft.json

microsoft has an article detailing the differences when migrating to system.text.json:

https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to?pivots=dotnet-6-0

🌐
Newtonsoft
newtonsoft.com › json › help › html › DefaultSettings.htm
Serialize with DefaultSettings
// settings will automatically be used by JsonConvert.SerializeObject/DeserializeObject JsonConvert.DefaultSettings = () => new JsonSerializerSettings { Formatting = Formatting.Indented, ContractResolver = new CamelCasePropertyNamesContractResolver() }; Staff s = new Staff { FirstName = "Eric", LastName = "Example", BirthDate = new DateTime(1980, 4, 20, 0, 0, 0, DateTimeKind.Utc), Department = "IT", JobTitle = "Web Dude" }; json = JsonConvert.SerializeObject(s); // { // "firstName": "Eric", // "lastName": "Example", // "birthDate": "1980-04-20T00:00:00Z", // "department": "IT", // "jobTitle": "Web Dude" // }
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › standard › serialization › system-text-json › how-to
How to serialize JSON in C# - .NET | Microsoft Learn
This article shows how to use the System.Text.Json namespace to serialize to JavaScript Object Notation (JSON). If you're porting existing code from Newtonsoft.Json, see How to migrate to System.Text.Json.
🌐
Scaleoutsoftware
static.scaleoutsoftware.com › docs › dotnet_client › articles › serialization › newtonsoft.html
Using Json.NET for Serialization | Scaleout.Client
using System; using System.Collections.Generic; using System.IO; using System.Text; using Newtonsoft.Json; using Scaleout.Client; public class Player { public string PlayerId { get; set; } public List<int> ScoreHistory { get; set; } } class Program { static void Main(string[] args) { var conn = GridConnection.Connect("bootstrapGateways=localhost:721"); // Configure cache for JSON serialization: var builder = new CacheBuilder<int, Player>("players", conn); builder.SetSerialization(SerializePlayer, DeserializePlayer); var playerCache = builder.Build(); } private static readonly UTF8Encoding UTF8
🌐
IronPDF
ironpdf.com › ironpdf blog › .net help › c# json serializer
C# Json Serializer (How It Works For Developers)
July 29, 2025 - Now, let's explore a practical example of how C# JSON serialization can be seamlessly integrated with IronPDF. Consider a scenario where you have a collection of data that needs to be presented in a PDF report. The data is initially stored as C# objects and needs to be converted into JSON format before being embedded into the PDF document using IronPDF. using IronPdf; using Newtonsoft.Json; using System.Collections.Generic; public class ReportData { public string Title { get; set; } public string Content { get; set; } } public class Program { static void Main() { var data = new List<ReportData> { new ReportData { Title = "Section 1", Content = "Lorem ipsum dolor sit amet."
🌐
Medium
medium.com › @harinim02 › serialize-and-deserialize-inherited-types-in-c-using-newtonsoft-json-8d204c4ccb60
Serialize and Deserialize inherited types in C# using NewtonSoft JSON | by Harini Murugan | Medium
June 7, 2022 - Serialization is a process of converting a C# object to a string (or rather a stream of bytes). Deserialization is done when we need to convert this string to an object. This article explains how you can achieve serialization/deserialization ...
🌐
Newtonsoft
newtonsoft.com › json
Json.NET - Newtonsoft
JArray array = new JArray(); array.Add("Manual text"); array.Add(new DateTime(2000, 5, 23)); JObject o = new JObject(); o["MyArray"] = array; string json = o.ToString(); // { // "MyArray": [ // "Manual text", // "2000-05-23T00:00:00" // ] // } ... Serialize and deserialize any .NET object with Json.NET's powerful JSON serializer.
🌐
Aspose
reference.aspose.com › email › net › newtonsoft.json.serialization
Newtonsoft.Json.Serialization | Aspose.Email for .NET API Reference
Newtonsoft.Json.Serialization · Classes · DnsClient.Protocol.Options Aspose.Email.Tools.Logging