© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
5 replies
fefene

Serialization and Deserialization Issues

Ive been trying to get serialization to work for my C# World object, but I'm recieving this error, quite often, but with different lines of course. An example of the error, the JSON it was trying to read, a specific excerpt of it, and more are provided below.

System.Text.Json.JsonException: 'The JSON value could not be converted to System.Collections.Generic.List`1[Lightrealm.District]. Path: $.WorldMap[3766].MyLocation.DistrictsToAdd | LineNumber: 33915 | BytePositionInLine: 27.'

I have some more infomration on my code in the attached text file, including an excerpt of the JSON. I've also attached the entire JSON file, but it is rather massive.

According to some of my research the file structure might not be parseable into a list? No information on how to fix that, or why the program would store it in a different way than it reads. I thought it would, in theory, serialize from the list and then deserialize it back into a list?

If anyone has run into issues like this with deserialization, or knows what I'm doing wrong, I would appreciate the help. I can provide more information if need be. Thank you!
The_Continent_of_Jacyxyirop.json22.59MB
code_excerpts.txt3.9KB
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Serialization/Deserialization
C#CC# / help
2y ago
❔ Serialization Posting Issues
C#CC# / help
4y ago
❔ Can someone explain to me what serialization and deserialization means?
C#CC# / help
3y ago