title: Code-First, when I go enable-migrations, I get “No context type was found in the assembly 'DOC'”
body: <p>I'm using Code-First, create a website using the standard template and then kept adding tables to the main <code>applicationDBContext</code>, however now when I go <strong>Enable-Migrations</strong> in <strong>Package Manager</strong> Console I get </p>
  
  <blockquote>
    <p>No context type was found in the assembly 'DOC'. </p>
  </blockquote>
  
  <p>and when I put the full path using:</p>
  
  <pre><code>ContextTypeName Option enable-migrations -ContextTypeName DOC.Migrations.Configuration
  </code></pre>
  
  <p>...I get:</p>
  
  <blockquote>
    <p>Migrations have already been enabled in project 'DOC'. To overwrite the existing migrations configuration, use the -Force parameter.</p>
  </blockquote>
  
  <p>And when I go <strong>-Force</strong>, it says </p>
  
  <blockquote>
    <p>Code First Migrations enabled for project DOC.</p>
  </blockquote>
  
  <p>but when I try to <strong>add-migration</strong> I get </p>
  
  <blockquote>
    <p>Error CS0311 The type 'DOC.Migrations.Configuration' cannot be used as type parameter 'TContext' in the generic type or method 'DbMigrationsConfiguration'. There is no implicit reference conversion from 'DOC.Migrations.Configuration' to 'System.Data.Entity.DbContext'. DOC xxxxxxx\DOC\Migrations\Configuration.cs.</p>
  </blockquote>
  
  <p>When I check the <strong>Configuration.cs</strong> file it changed it from: </p>
  
  <pre><code>internal sealed class Configuration : DbMigrationsConfiguration 
  </code></pre>
  
  <p>...to: </p>
  
  <pre><code>internal sealed class Configuration : DbMigrationsConfiguration
  </code></pre>
  
  <p>...causing the project fails to build</p>
  
  <p>The only time that I managed get this working by downgrading the entityframework from 6.1.3 to <strong>6.1.2</strong> and then re-upgrade.</p>
  
  <p>Sometimes, I have to upgrade and downgrade couple of times, close VS and re-open and then it works.</p>
  
  <p>Is there a solution to this? its very annoying.</p>
  
  <p><a href="https://i.stack.imgur.com/nQv8C.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nQv8C.png" alt="enter image description here"></a></p>
  
  <p>I have also noticed that my <code>DbContext</code> class derives from <code>IdentityDBContext</code>, is this ok? I know usually you derive it from <code>DbContext</code>, but since I started the project using the wizard, it created this automatically and I just added my other tables to it. </p>
  
  <p><a href="https://i.stack.imgur.com/eQVeF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/eQVeF.png" alt="enter image description here"></a></p>
  
  <p>My web.config</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!--
    For more information on how to configure your ASP.NET application, please visit
    http://go.microsoft.com/fwlink/?LinkId=301880
    --&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
  
    &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;&lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;&lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;&lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;&lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;&lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;&lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;&lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;&lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;&lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;&lt;/configSections&gt;
    &lt;connectionStrings&gt;
      &lt;add name="DefaultConnection" connectionString="data source=localhost\SQLTEST;initial catalog=DOC;User Id=xxx;Password=xxxx;multipleactiveresultsets=True;application name=EntityFramework" providerName="System.Data.SqlClient" /&gt;
      &lt;!--&lt;add name="DefaultConnection" connectionString="data source=zzzzz;initial catalog=DOC;User Id=zzzzzz;Password=zzzzz;multipleactiveresultsets=True;application name=EntityFramework" providerName="System.Data.SqlClient" /&gt;--&gt;
    &lt;/connectionStrings&gt;
    &lt;appSettings&gt;
      &lt;add key="webpages:Version" value="3.0.0.0" /&gt;
      &lt;add key="webpages:Enabled" value="false" /&gt;
      &lt;add key="ClientValidationEnabled" value="true" /&gt;
      &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
    &lt;/appSettings&gt;
    &lt;!--
      For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
  
      The following attributes can be set on the &lt;httpRuntime&gt; tag.
        &lt;system.Web&gt;
          &lt;httpRuntime targetFramework="4.5.2" /&gt;
        &lt;/system.Web&gt;
    --&gt;
    &lt;system.web&gt;
      &lt;authentication mode="None" /&gt;
      &lt;compilation debug="true" targetFramework="4.5.2" /&gt;
      &lt;httpRuntime targetFramework="4.5" /&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;security&gt;
        &lt;requestFiltering&gt;
          &lt;requestLimits maxAllowedContentLength="1073741824" /&gt;
        &lt;/requestFiltering&gt;
      &lt;/security&gt;
      &lt;modules&gt;
        &lt;remove name="FormsAuthentication" /&gt;
      &lt;/modules&gt;
      &lt;handlers&gt;
        &lt;remove name="ExtensionlessUrlHandler-Integrated-4.0" /&gt;
        &lt;remove name="OPTIONSVerbHandler" /&gt;
        &lt;remove name="TRACEVerbHandler" /&gt;
        &lt;add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /&gt;
      &lt;/handlers&gt;
    &lt;/system.webServer&gt;
    &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" /&gt;
          &lt;bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.AspNet.Identity.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="EntityFramework.MappingAPI" publicKeyToken="7ee2e825d201459e" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-6.1.0.9" newVersion="6.1.0.9" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /&gt;
          &lt;bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /&gt;
          &lt;bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /&gt;
          &lt;bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" /&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" /&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" /&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
    &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /&gt;
      &lt;providers&gt;
        &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /&gt;
      &lt;/providers&gt;
    &lt;/entityFramework&gt;
  &lt;/configuration&gt;
  </code></pre>