title: Trying to deserialize JSON into Dictionary<string, List<string>> in c#
body: <p>I'm trying to deserialize JSON into a dictionary with strings as keys and lists of strings as values. The way I did it is this:</p>
  <pre class="lang-json prettyprint-override"><code>[
      {
          &quot;key1&quot;: [
              &quot;value1.1&quot;,
              &quot;value1.2&quot;
          ]
      },
      {
          &quot;key2&quot;: [
              &quot;value2.1&quot;,
              &quot;value2.2&quot;
          ]
      },
  ]
  </code></pre>
  <p>and to deserialize:</p>
  <pre class="lang-cs prettyprint-override"><code>Dictionary&lt;string, List&lt;string&gt;&gt; dictionary;
  string text = File.ReadAllText(@&quot;Text.json&quot;);
  dictionary = JsonConvert.DeserializeObject&lt;Dictionary&lt;string, List&lt;string&gt;&gt;&gt;(text);
  </code></pre>
  <p>I am receiving the errors:</p>
  <blockquote>
  <p>Newtonsoft.Json.JsonSerializationException: 'Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'System.Collections.Generic.Dictionary<code>2[System.String,System.Collections.Generic.List</code>1[System.String]]' because the type requires a JSON object (e.g. {&quot;name&quot;:&quot;value&quot;}) to deserialize correctly.<br />
  To fix this error either change the JSON to a JSON object (e.g. {&quot;name&quot;:&quot;value&quot;}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
  Path '', line 1, position 1.'</p>
  </blockquote>
  <p>Does anyone have have any insights for me?</p>