title: Accessing EF ConnectionString from different project within same solution MVC
body: <p>In trying to practice separation of concerns, I am taking an ASP.NET MVC project and putting the Models and the DBContext into a separate project within the same solution. Now I have a Project.Web which houses the ViewModels, Controllers and Views and I have a Projects.Entities for the Models and DAL. The web.config file that has the ConnectionString attribute is in the Project.Web project.</p>
  
  <p>Project.Web</p>
  
  <pre><code>  &lt;connectionStrings&gt;
      &lt;add name="SchoolContext" connectionString="Data Source=localhost;Initial Catalog=ContosoUniversity1;Integrated Security=True" providerName="System.Data.SqlClient" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Home Controller:</p>
  
  <pre><code>public class HomeController : Controller
  {
      private SchoolContext db = new SchoolContext();
  </code></pre>
  
  <p>Project.Entities</p>
  
  <pre><code>public class SchoolContext : DbContext
  {
      public SchoolContext() : base("SchoolContext")
      {
  
      }
  </code></pre>
  
  <p>My issue is that the SchoolContext connectionString name isn't getting picked up by the DBContext because its in the web.config of the other project. How do I mitigate this? Everything works fine when all the MVC components are in the same project.</p>