© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
52 replies
moul7anout

Text.Json Error

Mates I am going fucking insane. I've been working on this for a while and it's just killing me.

"[{\"Id\":732870,\"UserId\":\"76561198432850031@steam\",\"LastSeen\":\"2022-12-27T00:31:32.738454\",\"FirstSeen\":\"2022-12-26T22:31:43.768427\",\"Activity\":{\"2022-12-26T00:00:00Z\":3209.0,\"2022-12-27T00:00:00Z\":1894.0},\"DoNotTrack\":false,\"Staff\":true,\"Kills\":0,\"Deaths\":0,\"ExperiencePoints\":0,\"ColaDrink\":1,\"Medkits\":0,\"AdrenalineShots\":0,\"Survival\":0,\"PocketEscapes\":0,\"RoundsPlayed\":6,\"Teamkills\":0,\"EscapeTimes\":[],\"Level\":0,\"Name\":null,\"IgnoreStats\":0}]"
"[{\"Id\":732870,\"UserId\":\"76561198432850031@steam\",\"LastSeen\":\"2022-12-27T00:31:32.738454\",\"FirstSeen\":\"2022-12-26T22:31:43.768427\",\"Activity\":{\"2022-12-26T00:00:00Z\":3209.0,\"2022-12-27T00:00:00Z\":1894.0},\"DoNotTrack\":false,\"Staff\":true,\"Kills\":0,\"Deaths\":0,\"ExperiencePoints\":0,\"ColaDrink\":1,\"Medkits\":0,\"AdrenalineShots\":0,\"Survival\":0,\"PocketEscapes\":0,\"RoundsPlayed\":6,\"Teamkills\":0,\"EscapeTimes\":[],\"Level\":0,\"Name\":null,\"IgnoreStats\":0}]"

I've got this json here.
It's giving me this exception:
"System.Text.Json.JsonException: The JSON value could not be converted to StatsBot.JsonHelper+Player[]. Path: $ | LineNumber: 0 | BytePositionInLine: 495.
"System.Text.Json.JsonException: The JSON value could not be converted to StatsBot.JsonHelper+Player[]. Path: $ | LineNumber: 0 | BytePositionInLine: 495.


For some reason, when I use a different json (attached in image) it works.

The code I'm using is
System.Text.Json.JsonSerializer.Deserialize<Player[]>(response.Content, Options);
System.Text.Json.JsonSerializer.Deserialize<Player[]>(response.Content, Options);

My options are just "PropertyNameCaseInsensitive" which is set to true.
image.png
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
Next page

Similar Threads

❔ ✅ System.Text.Json paths
C#CC# / help
3y ago
Create JSON objects from System.Text.Json
C#CC# / help
2y ago
Finding text in json files
C#CC# / help
3y ago
System.Text.Json Source Generators
C#CC# / help
3y ago