System.Text.Json can’t serialize Dictionary unless it has a string key

The built-in JSON serializer in .NET Core can’t handle serializing a dictionary unless it has a string key. When I run this code I get the following exception: System.NotSupportedException: The collection type ‘System.Collections.Generic.Dictionary`2[System.Int32,System.String]’ is not supported. It can only serialize dictionaries with string keys. This is bizarre, and another reason to stick with Newtonsoft for … Read more System.Text.Json can’t serialize Dictionary unless it has a string key