Dictionary<int, string> countries = new Dictionary<int, string>();
countries.Add(1, "Ukraine");
NuGet: newtonsoft json
string json = JsonConvert.SerializeObject(countries, Newtonsoft.Json.Formatting.Indented);
Console.WriteLine(json);