❔ ✅ JsonSerializer not serializing dictionary
I see this was an issue in .NET 6 and fixed in 7 however, it seems to still not be working in my project. All of my projects are on .NET 7 now, rebuilt, etc., dictionaries are being ignored. When I try the same code in LinqPad, it works fine.
Looking for ideas...
11 Replies
object explorer for System.Text.Json is showing 7.0.1
News to me. Sure We have plenty of dicts serialised ok in net5 and 6
It might be specifically
Dictionary<string, object>
GitHub
System.Text.Json.JsonSerializer does not work with Dictionary · Iss...
Description When a Dictionary<string, object> needs serialization, the .NET default System.Text.Json.JsonSerializer throws an exception: System.InvalidOperationException: Method may o...
Difference is, this issues says it was throwing, but mine is simply being ignored
super weird
OMG i need a vacation... nevermind.... the property not being serialized didn't even have a getter setter, it was declared as a field...
Oof
Yeah I miss the days when the IDE used to color fields differently than properties
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.