title: Reading json from file and deserializing always returns null
body: <p>I am reading Json from a file and when I try to deserialize it using Newtonsoft Json it returns null. I am constructing the JSON class from <a href="http://json2csharp.com/" rel="nofollow noreferrer">http://json2csharp.com/</a>
  . I am not sure of the reason why it says null is it because of the special symbols like \n,\r etc it introduces when using the StreamReader. Please help. </p>
  
  <p>Json (I checked with JsonLint and its valid json)</p>
  
  <pre><code>{
      "Machine Learning Functions": [{
          "Function": "JaccardDistance",
          "ArgCount": 2,
          "Arg1": "Point1",
          "Arg1Type": "Point",
          "Arg2": "Point2",
          "Arg2Type": "Point",
          "Return": "distance",
          "ReturnType": "Double"
      }],
      "Math Functions": [{
          "Function": "Cosine",
          "ArgCount": 2,
          "Arg1": "document1",
          "Arg1Type": "String",
          "Arg2": "document2",
          "Arg2Type": "String",
          "Return": "angle",
          "ReturnType": "Integer"
      }, {
          "Function": "SQRT",
          "ArgCount": 1,
          "Arg1": "SomeNumber",
          "Arg1Type": "Integer",
          "Return": "Number",
          "ReturnType": "Integer"
      }]
  
  }
  </code></pre>
  
  <p>C# code (taken from json2csharp)</p>
  
  <pre><code> public class MachineLearningFunction
      {
          public string Function { get; set; }
          public int ArgCount { get; set; }
          public string Arg1 { get; set; }
          public string Arg1Type { get; set; }
          public string Arg2 { get; set; }
          public string Arg2Type { get; set; }
          public string Return { get; set; }
          public string ReturnType { get; set; }
      }
  
      public class MathFunction
      {
          public string Function { get; set; }
          public int ArgCount { get; set; }
          public string Arg1 { get; set; }
          public string Arg1Type { get; set; }
          public string Arg2 { get; set; }
          public string Arg2Type { get; set; }
          public string Return { get; set; }
          public string ReturnType { get; set; }
      }
  
      public class RootObject
      {
          public List&lt;MachineLearningFunction&gt; MachineLearningFunctions { get; set; }
          public List&lt;MathFunction&gt; MathFunctions { get; set; }
      }
  </code></pre>
  
  <p>This json is stored Into a file and I am reading as follows when I keep a break point it reads the string by introducing some special charecters like \n,\r etc. But when I try to deserialize the break point shows null and I get a null reference exception when iterating through the list.</p>
  
  <pre><code> string json = string.Empty;
              using (StreamReader reader = new StreamReader(@"C:\Users\Nikh\OneDrive\Documents\Application/json.txt"))
              {
                  json = reader.ReadToEnd();
              }
   ParseAndConstructJson(json);
  
  public void ParseAndConstructJson(string json) //Using Newtonsoft json
          {
              RootObject obj = JsonConvert.DeserializeObject&lt;RootObject&gt;(json);
              foreach (var item in obj.MachineLearningFunctions)
              {
                  MessageBox.Show(item.Function);
              }//DataGrid dg = new DataGrid();
  }
  </code></pre>