title: Why does a client project need reference both to the base and the intermediate project?
body: <p>I have 3 projects: the base one, intermediate and client. Client access base project trough intermediate one. I simplified here my problem. I have a solution with 3 projects:</p>
  
  <pre><code>// Animals project
  public class FarmAnimal
  {
      public string GetFood { get; protected set; }
  }
  
  public class Cow : FarmAnimal
  {
      public Cow()
      {
          GetFood = "Milk";
      }
  
  }
  
  public class Chicken : FarmAnimal
  {
      public Chicken()
      {
          GetFood = "Egg";
      }
  
  }
  
  // Farmer project
  public class AbstractFarmer&lt;TAnimal&gt; where TAnimal : FarmAnimal, new()
  {
      protected TAnimal animal = new TAnimal();
      public string GetProduct()
      {
          return animal.GetFood;
      }
  }
  
  public class CowFarmer: AbstractFarmer&lt;Cow&gt;
  {
  
  }
  
  public class ChickenFarmer : AbstractFarmer&lt;Chicken&gt;
  {
  
  }
  
  // Client project
  class Program
  {
      static void Main(string[] args)
      {
          var cowFarmer = new CowFarmer();
          Console.WriteLine(cowFarmer.GetProduct());
      }
  }
  </code></pre>
  
  <p>If the client project doesn't add reference to the animals, then it gives:</p>
  
  <blockquote>
    <p>Error 1 The type 'Animals.FarmAnimal' is defined in an assembly that is not referenced. You must add a reference to assembly 'Animals, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.</p>
  </blockquote>
  
  <p>The principle of encapsulation says that the client should not know about "Animals", only about the intermediate ("Farmers").</p>
  
  <p>How can I solve this problem and why does it appear?</p>