System.String[*] and System.String[] Difference in C#
<p><strong>Edit</strong>: I know that C# equivalent of <code>For Each server As String In servers</code> is <code>foreach(var item in servers)</code> but since <code>GetOPCServers</code> returns object, it should be cast to iterable type.</p>

<hr>

<p>I am developing an application using a COM library. Since 64bit causes problems, my target CPU x86.</p>

<p>All methods works as expected, except <code>GetOPCServers()</code>.</p>

<p>Although Visual Basic code using same dll does not cause problem, C# throws <code>System.InvalidCastException</code> saying that:</p>

<pre><code>A first chance exception of type 'System.InvalidCastException' 
occurred in System.Core.dll

Additional information: 
'System.String[*]' türündeki nesne 'System.String[]' türüne atılamadı.
</code></pre>

<p>Apologizes for the error message, since my OS in Turkish.</p>

<blockquote>
  <p>The object in type <code>System.String[*]</code> can not be <strong>assigned</strong> to <code>System.String[]</code></p>
</blockquote>

<p>What is diffence between <code>System.String[*]</code> and <code>System.String[]</code>?</p>

<p><strong>The VB code using same dll runs without exception</strong></p>

<pre><code>Public Class OpcInfo
  Dim servers As VariantType
  Dim server As OPCAutomation.OPCServer = New OPCAutomation.OPCServer()


  Function GetServers()
    Dim servers As Object
    Dim _servers As New List(Of String)

    servers = server.GetOPCServers()

    For Each server As String In servers
      _servers.Add(server)
    Next
    Return _servers
  End Function
End Class
</code></pre>

<p><strong>But the the C# code also uses same dll throws exception</strong></p>

<pre><code>static void Main(string[] args)
{
    var opc_servers = new OPCAutomation.OPCServer().GetOPCServers();
    foreach (var item in (string[])opc_servers)
    {
        Console.WriteLine(item);
    }
}
</code></pre>

<p><strong>More interestingly, I able to view the data in Watch/Immediate windows:</strong></p>

<p><a href="https://i.stack.imgur.com/syvlq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/syvlq.png" alt="watch window"></a></p>

<p>The error code <code>-2147467262</code> corresponds to <code>FFFFFFFF80004002</code> and the explanation according to <a href="https://technet.microsoft.com/en-us/library/bb632794.aspx" rel="nofollow noreferrer">https://technet.microsoft.com/en-us/library/bb632794.aspx</a></p>

<pre><code>E_NOINTERFACE 
FFFFFFFF80004002
-2147467262
No such interface supported
</code></pre>