title: Configure multiple database Entity Framework 6
body: <p>In my solution I have 2 projects that use Entity Framework 6. Each points to a different database, both using the same data provide - SQL Server.
  A third project in my solution needs to use both databases. My problem is how to configure those context. I tried to create a configuration class in a separate assembly:</p>
  <pre><code>namespace OSAD_Base
  {
      class EfDbConfiguration : DbConfiguration
      {
          public EfDbConfiguration()
          {
              SetProviderServices(SqlProviderServices.ProviderInvariantName, SqlProviderServices.Instance);
          }
      }
  }
  </code></pre>
  <p>and referencing to this configuration in each context class:</p>
  <pre><code>namespace IntegrationDb
  {
      [DbConfigurationType(&quot;OSAD_Base.EfDbConfiguration, OSAD_Base&quot;)]
      public partial class IntegrationEntities : DbContext
      {
          public IntegrationEntities(string connectionString)
              : base(connectionString)
          {
          }
      }
  }
  </code></pre>
  <p>When initializing my first, all works correct, but when the second context initializes (Order does not matter) I get and error:</p>
  <blockquote>
  <p>An instance of 'EfDbConfiguration' was set but this type was not discovered in the same assembly as the 'B1Entities' context. Either put the DbConfiguration type in the same assembly as the DbContext type, use DbConfigurationTypeAttribute on the DbContext type to specify the DbConfiguration type, or set the DbConfiguration type in the config file. See <a href="http://go.microsoft.com/fwlink/?LinkId=260883" rel="noreferrer">http://go.microsoft.com/fwlink/?LinkId=260883</a> for more information.*</p>
  </blockquote>
  <p>I also tried to create an entityframework section in my app.config (of the start up project) but got the following error:</p>
  <blockquote>
  <p>Configuration system failed to initialize</p>
  <p>Unrecognized configuration section entityFramework</p>
  </blockquote>
  <p>How can I use 2 separate EF Projects in the same solution?</p>