title: InvalidCastException Dictionary<string, string> using Exception.Data
body: <p>I have a Client/Server package that I am playing with, I am trying to use Exception.Data to pass custom information into a separate class (ExceptionError) to pass into a MessageBox.</p>
  
  <p>The following catch processes when I try to connect to the server without actually starting up the server to listen for connections.  just an oversight on that part, listening for connections is not the actual problem but it shows me the problem with Exception.Data.</p>
  
  <pre><code>catch (Exception e)
  {
      e.Data["SourceFile"] = "Client.cs";
      e.Data["MethodName"] = "Send_CommandToServer";
      e.Data["ExceptionType"] = "Exception";
      object[] exceptionArgs = new object[8] { null, e.InnerException, 
                                e.Message, null, e.Source, e.StackTrace, 
                                e.TargetSite, e.Data };
      ExceptionError.Show(exceptionArgs);
  }
  </code></pre>
  
  <p>Here is the line in the ExceptionError Class that is throwing the InvalidCastException:</p>
  
  <pre><code>Dictionary&lt;string,string&gt; data = (Dictionary&lt;string, string&gt;)exceptionArgs[7];
   // exceptionArgs[7] is Exception.Data
  </code></pre>
  
  <p>Here is the actual Error I am receiving:</p>
  
  <blockquote>
    <p>Unable to cast object of type 'System.Collections.ListDictionaryInternal' to type 'System.Collections.Generic.Dictionary`2[System.String,System.String]'.</p>
  </blockquote>
  
  <p>I cannot find anything about ListDictionaryInternal, most of the google searches I have done point to System.Collections.Specialized.ListDictionary which produces issues of its own.  Does anyone know anything about ListDictionaryInternal or can you help me with passing e.Data into my ExceptionError Class?</p>