title: Invalid cast from 'System.Int32' to 'System.Nullable`1[[System.Int32, mscorlib]]
body: <pre><code>Type t = typeof(int?); //will get this dynamically
  object val = 5; //will get this dynamically
  object nVal = Convert.ChangeType(val, t);//getting exception here
  </code></pre>
  
  <p>I am getting InvalidCastException in above code. For above I could simply write <code>int? nVal = val</code>, but above code is executing dynamically. </p>
  
  <p>I am getting a value(of non nullable type like int, float, etc) wrapped up in an object (here val), and I have to save it to another object by casting it to another type(which can or cannot be nullable version of it). When </p>
  
  <blockquote>
    <p>Invalid cast from 'System.Int32' to 'System.Nullable`1[[System.Int32,
    mscorlib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=b77a5c561934e089]]'.</p>
  </blockquote>
  
  <p>An <code>int</code>, should be convertible/type-castable to <code>nullable int</code>, what is the issue here ?</p>