title: No context type was found in the assembly EF6
body: <p>I'm working on a nopCommerce based project. In order to update custom entity I want to enable EF migrations. So I run following command:</p>
  
  <pre><code>Enable-Migrations -StartUpProjectName nop.web -ContextProjectName Nop.Plugin.Payments.Deposit -verbose
  </code></pre>
  
  <p>and get the error: </p>
  
  <pre><code>Using StartUp project 'Nop.Web'.
  System.Data.Entity.Migrations.Infrastructure.MigrationsException: No context type was found in the assembly 'Nop.Plugin.Payments.Deposit'.
     at System.Data.Entity.Utilities.TypeFinder.FindType(Type baseType, String typeName, Func`2 filter, Func`2 noType, Func`3 multipleTypes, Func`3 noTypeWithName, Func`3 multipleTypesWithName)
     at System.Data.Entity.Migrations.Design.ToolingFacade.GetContextTypeRunner.Run()
     at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
     at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
     at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)
     at System.Data.Entity.Migrations.Design.ToolingFacade.GetContextType(String contextTypeName)
     at System.Data.Entity.Migrations.EnableMigrationsCommand.FindContextToEnable(String contextTypeName)
     at System.Data.Entity.Migrations.EnableMigrationsCommand.&lt;&gt;c__DisplayClass2.&lt;.ctor&gt;b__0()
     at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
  No context type was found in the assembly 'Nop.Plugin.Payments.Deposit'.
  </code></pre>
  
  <p>The context class is defined as following:</p>
  
  <pre><code>public class DepositTransactionObjectContext : DbContext, IDbContext
  {
      public DepositTransactionObjectContext(string nameOrConnectionString) : base(nameOrConnectionString) { }
  
      public DepositTransactionObjectContext() { }
  
      public IList&lt;TEntity&gt; ExecuteStoredProcedureList&lt;TEntity&gt;(string commandText, params object[] parameters) where TEntity : BaseEntity, new()
      {
          throw new System.NotImplementedException();
      }
  
      public IEnumerable&lt;TElement&gt; SqlQuery&lt;TElement&gt;(string sql, params object[] parameters)
      {
          throw new System.NotImplementedException();
      }
  
      public int ExecuteSqlCommand(string sql, bool doNotEnsureTransaction = false, int? timeout = null, params object[] parameters)
      {
          throw new System.NotImplementedException();
      }
  
      public void Detach(object entity)
      {
          throw new System.NotImplementedException();
      }
  
      public bool ProxyCreationEnabled { get; set; }
      public bool AutoDetectChangesEnabled { get; set; }
  
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          modelBuilder.Configurations.Add(new DepositTransactionMap());
  
          base.OnModelCreating(modelBuilder);
      }
  
      public string CreateDatabaseInstallationScript()
      {
          return ((IObjectContextAdapter)this).ObjectContext.CreateDatabaseScript();
      }
  
      public void Install()
      {
          //It's required to set initializer to null (for SQL Server Compact).
          //otherwise, you'll get something like "The model backing the 'your context name' context has changed since the database was created. Consider using Code First Migrations to update the database"
          Database.SetInitializer&lt;DepositTransactionObjectContext&gt;(null);
  
          Database.ExecuteSqlCommand(CreateDatabaseInstallationScript());
          SaveChanges();
      }
  
      public void Uninstall()
      {
          this.DropPluginTable("DepositTransaction");
      }
  
      public new IDbSet&lt;TEntity&gt; Set&lt;TEntity&gt;() where TEntity : BaseEntity
      {
          return base.Set&lt;TEntity&gt;();
      }
  }
  </code></pre>
  
  <p>I've created empty project and enabled migrations there. Then I've copied and adjusted Configuration.cs so it looks like this:</p>
  
  <pre><code>namespace Nop.Plugin.Payments.Deposit.Migrations
  {
      using Data;
      using System.Data.Entity.Migrations;
  
      internal sealed class Configuration : DbMigrationsConfiguration&lt;DepositTransactionObjectContext&gt;
      {
          public Configuration()
          {
              AutomaticMigrationsEnabled = true;
          }
  
          protected override void Seed(DepositTransactionObjectContext context)
          {
          }
      }
  }
  </code></pre>
  
  <p>However when I run Add-Migration I get following error:</p>
  
  <pre><code>Using StartUp project 'Nop.Web'.
  Using NuGet project 'Nop.Plugin.Payments.Deposit'.
  System.Data.Entity.Migrations.Infrastructure.MigrationsException: No migrations configuration type was found in the assembly 'Nop.Plugin.Payments.Deposit'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).
     at System.Data.Entity.Utilities.TypeFinder.FindType(Type baseType, String typeName, Func`2 filter, Func`2 noType, Func`3 multipleTypes, Func`3 noTypeWithName, Func`3 multipleTypesWithName)
     at System.Data.Entity.Migrations.Utilities.MigrationsConfigurationFinder.FindMigrationsConfiguration(Type contextType, String configurationTypeName, Func`2 noType, Func`3 multipleTypes, Func`3 noTypeWithName, Func`3 multipleTypesWithName)
     at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.FindConfiguration()
     at System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldRunner.Run()
     at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
     at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
     at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)
     at System.Data.Entity.Migrations.Design.ToolingFacade.Scaffold(String migrationName, String language, String rootNamespace, Boolean ignoreChanges)
     at System.Data.Entity.Migrations.AddMigrationCommand.Execute(String name, Boolean force, Boolean ignoreChanges)
     at System.Data.Entity.Migrations.AddMigrationCommand.&lt;&gt;c__DisplayClass2.&lt;.ctor&gt;b__0()
     at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
  No migrations configuration type was found in the assembly 'Nop.Plugin.Payments.Deposit'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).
  </code></pre>
  
  <p>I read a lot of same questions and everywhere the reason was wrong project specified in the Enable-Migrations cmdlet (not one having context defined). But it's not my case as you can see. </p>
  
  <p>What else could be a reason?</p>