title: Inheritance across different (shared) projects & namespaces
body: <p>My solution contains three projects:</p>
  
  <ul>
  <li>Shared Project
  
  <ul>
  <li>Contains a <code>LowestLevel</code> class, and a <code>MidLevel</code> class which inherits from <code>LowestLevel</code></li>
  </ul></li>
  <li>Class Library 
  
  <ul>
  <li>Contains reference to Shared Project</li>
  <li>Contains a <code>HighestLevel</code> class, which inherits from the <code>MidLevel</code> class mentioned above</li>
  </ul></li>
  <li>Console Application
  
  <ul>
  <li>Contains reference to Class Library and Shared Project</li>
  </ul></li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/zLr0r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zLr0r.png" alt="enter image description here"></a></p>
  
  <p>I've included the code for these classes below - note that each project has its own namespace</p>
  
  <pre><code>namespace ClassLib
  {
      public class HighestLevel : MidLevel
      {
          public HighestLevel() { }
      }
  }
  
  namespace SharedProj
  {
      public class MidLevel : LowestLevel
      {
          public MidLevel() { }
      }
  
      public class LowestLevel
      {
          public LowestLevel() { }
      }
  }
  </code></pre>
  
  <p>Within my Console Applications <code>Program</code> class, I'm trying to create a new instance of the <code>HighestLevel</code> class, like so</p>
  
  <pre><code>LowestLevel myclass = new HighestLevel();
  </code></pre>
  
  <p>However this giving an error in Visual Studio, stating</p>
  
  <p><code>Cannot implicitly convert type ClassLib.HighestLevel to SharedProj.LowestLevel</code> </p>
  
  <p>Can anyone help me understand why this is, and how I can work around it? It seems that this issue doesnt come up when these three classes are all within the same project/namespace, so perhaps its caused by the approach of splitting these classes across various projects. </p>