title: The entry (Database) has already been added
body: <p>I have two applications that are sharing the same database that is an <code>API</code> and an <code>MVC5</code> app. Both run well on localhost but on deployment to my Azure account i get this error</p>
  
  <pre><code> Configuration Error
  
  Description: An error occurred during the processing of a configuration
               file required to service this request. Please review the
               specific error details below and modify your configuration file appropriately.
  
  Parser Error Message: The entry 'XlabDatabase' has already been added.
  
  Source Error:
  
   An application error occurred on the server. The current custom error settings
   for this application prevent the details of the application error from being viewed remotely (for security reasons)
  </code></pre>
  
  <p>I have taken steps to even rename the database but on deployment i use the same remote string</p>
  
  <p>here is my MVC app connectionstring</p>
  
  <pre><code>&lt;connectionStrings&gt;
     &lt;add name="XlabDatabase_acc" providerName="System.Data.SQLClient" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;MultipleActiveResultSets=true;App=EntityFramework" /&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Here's my MVC Context</p>
  
  <pre><code>    public virtual DbSet&lt;Account&gt; Accounts { get; set; }
      public virtual DbSet&lt;AnnualReport&gt; AnnualReports { get; set; }
      public virtual DbSet&lt;MonthlyReport&gt; MonthlyReports { get; set; }
      public virtual DbSet&lt;WeekReport&gt; WeekReports { get; set; }
  
      protected override void OnModelCreating(DbModelBuilder builder)
      {
          base.OnModelCreating(builder);
          builder.Entity&lt;AnnualReport&gt;().HasKey&lt;int&gt;(x =&gt; x.AnnualReportID);
          builder.Entity&lt;MonthlyReport&gt;().HasKey&lt;int&gt;(x =&gt; x.MonthlyReportID);
          builder.Entity&lt;WeekReport&gt;().HasKey&lt;int&gt;(x =&gt; x.ReportID);
  
      }
  </code></pre>
  
  <p>Here's my API connection string</p>
  
  <pre><code>  &lt;connectionStrings&gt;
       &lt;add name="XlabDatabase" providerName="System.Data.SQLClient" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;MultipleActiveResultSets=true;" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Here's my API context</p>
  
  <pre><code> public virtual DbSet&lt;Customers&gt; Customers { get; set; }
      public virtual DbSet&lt;Salesman&gt; Salesman { get; set; }
      public virtual DbSet&lt;Route&gt; Route { get; set; }
      public virtual DbSet&lt;Purchase&gt; Purchase { get; set; }
      public virtual DbSet&lt;Products&gt; Products { get; set; }
      public virtual DbSet&lt;Assets&gt; Assets { get; set; }
      public virtual DbSet&lt;WeekReports&gt; WKReports { get; set; }
      public virtual DbSet&lt;MonthlyReports&gt; MONReports { get; set; }
      public virtual DbSet&lt;AnnualReports&gt; ANNReports { get; set; }
      public virtual DbSet&lt;Accounts&gt; Accounts { get; set; }
      public virtual DbSet&lt;LoadingOrder&gt; LoadingOrder { get; set; }
  
  
      protected override void OnModelCreating(DbModelBuilder builder)
      {
  
          base.OnModelCreating(builder);
  
          builder.Conventions.Remove&lt;PluralizingTableNameConvention&gt;();
          builder.Entity&lt;LoadingOrder&gt;().HasRequired(c =&gt; c.Salesman).WithMany().WillCascadeOnDelete(false);
          builder.Entity&lt;IdentityUserClaim&gt;().ToTable("UserClaim").HasKey&lt;Int32&gt;(r =&gt; r.Id);
          builder.Entity&lt;IdentityUserLogin&gt;().ToTable("UserLogin").HasKey&lt;string&gt;(l =&gt; l.UserId);
          builder.Entity&lt;IdentityRole&gt;().ToTable("Role").HasKey&lt;string&gt;(r =&gt; r.Id);
          builder.Entity&lt;User&gt;().ToTable("User").HasKey(r =&gt; new{ r.IDNumber, r.UserName});
          builder.Entity&lt;IdentityUser&gt;().ToTable("User").HasKey&lt;string&gt;(r =&gt; r.UserName);
          builder.Entity&lt;IdentityUserRole&gt;().ToTable("UserRole").HasKey(r =&gt; new { r.RoleId, r.UserId });
  
      }
  </code></pre>
  
  <p>I have deployed the two applications into two different Virtual Applications and Directories.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>This is how i deploy the two applications they share the same connection string</p>
  
  <p><a href="https://i.stack.imgur.com/68esW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/68esW.png" alt="enter image description here"></a></p>
  
  <p>I have also added the <code>Initial Catalog</code> to the connection strings 
  <code>XLAB</code></p>