title: Unable to cast C#
body: <p>I have 2 different projects in my solution.</p>
  
  <p>In one I have a class called MyClass1, and in the other I have MyClass2
  These classes are identical in all but name.</p>
  
  <p>In one project I have a list of Objects. During runtime the list gets filled with MyClass1 objects that
  we casted to an object.</p>
  
  <p>At the end I want to cast each object in the list to a MyClass2 object.</p>
  
  <p>Currently it throws an exception saying Unable to cast object of type MyClass1 to MyClass2.</p>
  
  <p>My Code:</p>
  
  <pre><code>List&lt;Object&gt; _tempObjects = new List&lt;Objects&gt;();
  foreach(Object myObjectInput in _tempObjects)
  {
    MyClass2 temp = (MyClass2) myObjectInput; // here is where it dies
  }
  </code></pre>
  
  <p>The two classes are the same, just different names.
  I have also tried:</p>
  
  <pre><code> MyClass2 temp = myObjectInput as MyClass2; 
  </code></pre>