title: Is it correct to add a reference to an assembly that is not directly used by the project?
body: <p>I have a solution composed by 3 projects.</p>
  
  <ul>
  <li>one for <strong>Entity framework</strong> that contains my edmx diagram</li>
  <li>one for my <strong>core business</strong></li>
  <li>and one for my <strong>web app</strong></li>
  </ul>
  
  <p>When I publish my code on a server or hosting service I get this runtime error:</p>
  
  <blockquote>
    <p>{"Could not load file or assembly 'EntityFramework, Version=4.4.0.0,
    Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its
    dependencies. The system cannot find the file
    specified.":"EntityFramework, Version=4.4.0.0, Culture=neutral,
    PublicKeyToken=b77a5c561934e089"}</p>
  </blockquote>
  
  <p>I get this error because my entity framework assemblies is not published. The entity framework dll file is missing on my server. I know why. I didn't referenced it in my web app project because this assemblies is not required in this project. The assembly is referenced in my two other projects.</p>
  
  <p>I can easily fix my issue by adding the entity framework reference in my web app. Can I do that? yes but is it good programming to add a reference to an assembly that is not directly used by the project? What can I do?</p>
  
  <hr>
  
  <h2>More information</h2>
  
  <ul>
  <li>one for <strong>Entity framework</strong>: reference Entity Framework </li>
  <li>one for my <strong>core business</strong>: reference Entity Framework because I manipulate my entities here</li>
  <li>and one for my <strong>web app</strong>: web site that act like facade between the UI and the core business. I don't reference or use Entity Framework here.</li>
  </ul>
  
  <p>I don't have any compilation error> I only have a runtime error because my entity framework is not published. </p>
  
  <p>In Windows Application in this case I don't reference my dll in the project but I copy it with a post build action. I don't know what to do in the case of a web app I need to publish or deploy.</p>