title: Getting MetaData information from a file using C#
body: <p>I was trying to get the metadata from a file using Shell. I am using MVC5 and Windows 8 OS. Here is the below code.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>public JsonResult Ind(string file)
  {
      List&lt;string&gt; arrHeaders = new List&lt;string&gt;();
      string filename = Path.GetFileName(file);
      Shell shell = new ShellClass();
      Folder rFolder = shell.NameSpace(file);
      FolderItem rFiles = rFolder.ParseName(filename);
      for (int i = 0; i &lt; short.MaxValue; i++)
      {
           string value = rFolder.GetDetailsOf(rFiles, i).Trim();
           arrHeaders.Add(value);
      }
      return Json(arrHeaders, JsonRequestBehavior.AllowGet);
   }
  </code></pre>
  
  <p>When I try to run the above code, I am getting error <strong>Unable to cast COM object of type 'Shell32.ShellClass' to interface type 'Shell32.IShellDispatch6'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{286E6F1B-7113-4355-9562-96B7E9D64C54}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).</strong></p>
  
  <p>Is there any other better solution to read metadata from different file formats?? Pls suggest me anything. I ll appreciate you.</p>
  
  <p>Thanks</p>