Casting object to int throws InvalidCastException in C#
<p>I have this method:</p>

<pre><code>private static Dossier PrepareDossier(List&lt;List&lt;object&gt;&gt; rawDossier)
{
    return new Dossier((int)rawDossier[0][0]);
}
</code></pre>

<p>When I use it I get an <code>InvalidCastException</code>. However, when I use <code>Convert.ToInt32(rawDossier[0][0])</code> it works just fine. What is the problem?</p>