title: How To Solve CA2202:To avoid generating a System.ObjectDisposedException Warning
body: <p>Every time on visual studio 2015, when i run <code>Code Analysis</code>, there are some annoying warnings. All of them are in a methods like this:</p>
  
  <p><strong>here is my method:</strong></p>
  
  <pre><code>public static JObject ReadJson(string file_path)
  {
      try {
          JObject o1 = JObject.Parse(File.ReadAllText(file_path));
          using (StreamReader file = File.OpenText(file_path))
          {
              using (JsonTextReader reader = new JsonTextReader(file))
              {
                  return (JObject)JToken.ReadFrom(reader);//the warning is here
              }
          }
      }
      catch
      {
          return default(JObject);
      }
  
  }
  </code></pre>
  
  <p>so why this warning occur? How to solve it? And the most important is what
  my fault in this method it seems to me very perfect</p>
  
  <p><strong>Warning Description</strong></p>
  
  <blockquote>
    <p>Severity  Code    Description Project File    Line Warning        CA2202 :
    Microsoft.Usage : Object 'file' can be disposed more than once in
    method 'JsonHelper.ReadJson(string)'. To avoid generating a
    System.ObjectDisposedException you should not call Dispose more than
    one time on an object.</p>
  </blockquote>