question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Serialization/Deserialization in .net core 5.0

See original GitHub issue

There is problem during Json deserialization for list of TvShows which were previously serialized in .net core 5.0 using serializer from System.Text.Json:

var jsonStr = JsonSerializer.Serialize(obj); // obj is List<TvShow>

I got error message:

Newtonsoft.Json.JsonSerializationException: ‘Could not create an instance of type TMDbLib.Objects.Changes.ChangeItemBase. Type is an interface or abstract class and cannot be instantiated. Path ‘[19].Changes.Changes[0].Items[0].Action’, line 1, position 434211.’

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
LordMikecommented, Apr 15, 2021

I’ve refactored the serialization into a new ITMDbSerializer interface. This change removes all Newtonsoft.Json from all API surfaces…

  • The constructor will no longer take a JsonSerializer
  • The Newtonsoft.Json dependency is hidden, so it is no longer transient
  • There is a TMDbJsonSerializer.Instance which has the internal serializer
0reactions
lewishensoncommented, Apr 9, 2021

Ah good to know thanks. I might take a look this weekend then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to serialize and deserialize JSON using C# - .NET
Learn how to use the System.Text.Json namespace to serialize to and deserialize from JSON in .NET. Includes sample code.
Read more >
Serialization and Deserialization in C# - Code Maze
Deserialization is the process of converting the serialized stream of data into the original object state. This ensures that the original state ...
Read more >
JSON serialization/deserialization in ASP.Net Core
It deserializes objects from JSON and serializes objects to JSON. Memory allocations are kept minimal and includes support for reading and ...
Read more >
DotNet 5: Serialization and Deserialization Json Serialization
DotNet 5 : Serialization and Deserialization Json Serialization. 916 views · 2 years ago ...more. Tech In Talk. 2.1K. Subscribe. 5. Share.
Read more >
DotNet 5: Serialization and Deserialization Xml ... - YouTube
Comments · DotNet 5 : Serialization and Deserialization Json Serialization · Xml Serialization and Deserialization in C#.net · How to serialize and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found