title: Asp.Net Application using MySql + Entity Framework
body: <p>My question is simple: Why do I have to reference MySql.Data.Entity on my ASP.NET Application in order to work with MySql Entity Framework 5 in a class library?</p>
  
  <p>I explain: I've structured a sample application in 2 layers: Asp.Net Web App and a Class Library (both in VB.NET)</p>
  
  <p>I referenced MySql.Data and MySql.Data.Entity on the Class Library, where I created my Code First model and my DbContext.</p>
  
  <p>I referenced MySql.Web on Asp.Net App and put the DbProviders on Web Config and connection strings.</p>
  
  <p>When I try to run a simple query, it fails with a generic NullPointerException on MySql.Data.MySqlClient.MySqlClientFactory.get_MySqlDbProviderServicesInstance()</p>
  
  <p>However, if i install MySql.Data.Entity on the Web App, then all goes as a bed of roses.</p>
  
  <p>In my thoughts, if I'm separating the Data Access Layer from the Presentation, why do I have to reference a dll that is used only in the Data Layer? Is this in any way related to how CLR loads assemblies? Or am I doing something wrong?</p>