title: JSON Deserialization C#
body: <p>I'm trying to parse out some information I've retrieved from RottenTomatoes that's in a JSON format</p>
  
  <pre><code>{
      "cast": [
          {
              "id": "162655641",
              "name": "Tom Hanks",
              "characters": [
                  "Woody"
              ]
          },
          {
              "id": "162655909",
              "name": "Tim Allen",
              "characters": [
                  "Buzz Lightyear"
              ]
          },
          {
              "id": "162655020",
              "name": "Joan Cusack",
              "characters": [
                  "Jessie the Cowgirl"
              ]
          },
          {
              "id": "162672460",
              "name": "Ned Beatty",
              "characters": [
                  "Lots-o'-Huggin' Bear",
                  "Lotso"
              ]
          },
          {
              "id": "162657445",
              "name": "Richard Kind",
              "characters": [
                  "Bookworm"
              ]
          },
          {
              "id": "162654813",
              "name": "Erik von Detten",
              "characters": [
                  "Sid"
              ]
          },
          {
              "id": "770713272",
              "name": "James Anthony Cotton",
              "characters": []
          }
      ],
      "links": {
          "rel": "http://api.rottentomatoes.com/api/public/v1.0/movies/770672122.json"
      }
  }
  </code></pre>
  
  <p>I'm just trying to get this code to work but I'm getting an InvalidOperationException and this error
  "Type 'System.String' is not supported for deserialization of an array."</p>
  
  <p>Here's my code in main</p>
  
  <pre><code>string json = File.ReadAllText("json.txt");
  
  CastInfo castMember = new JavaScriptSerializer().Deserialize&lt;CastInfo&gt;(json);
  </code></pre>
  
  <p>Here are my classes</p>
  
  <pre><code>public class CastInfo
  {
      public List&lt;CustomCastInfo&gt; cast { get; set; }
  }
  public class CustomCastInfo
  {
      public string id { get; set; }
      public string name { get; set; }
      public List&lt;string&gt; characters { get; set; }
  
  }
  </code></pre>
  
  <p>And advice? And I realize I need to do something about the "links" in the bottom, but even when I delete that it still doesn't work.</p>