title: Cast Object Base Class in Object Derived Class
body: <p>I'm running the following code:</p>
  
  <pre><code>public class CfgObject
  {
      protected object _inst;
      public CfgObject(object inst) { _inst = inst; }
  }
  public class CfgService : CfgObject
  {
      public object GetObject() { return _inst; }
      public CfgService(object inst) : base(inst) {}
  }
  ...
  CfgObject obj1 = new CfgObject((object)1);
  CfgService service = (CfgService)obj1;
  service.GetObject();
  ...
  </code></pre>
  
  <p>I always receive </p>
  
  <blockquote>
    <p>System.InvalidCastException (Unable to cast object of type 'CfgObject' to type 'CfgService')</p>
  </blockquote>
  
  <p>What is the correct way of doing?</p>