I am trying to configure the first migrations of EF code to EF 6.1.3-.NET 4.5.
There are several projects in my solution, the launch project is Songbirds.Web . I created a project called Songbirds.Dal.EntityFramework to contain my repositories, database context, and migrations.
I created my context class:
namespace Songbirds.Dal.EntityFramework { public class SongbirdsDbContext : IdentityDbContext<ApplicationUser>, IUnitOfWork { public SongbirdsDbContext() : this("name=SongbirdsDBContext") { } ... } }
The whole solution is built correctly, without errors.
I go into the Project Manager console and set the default project as Songbirds.Dal.EntityFramework and run the enable-migrations command, and I get the following error:
PM> enable-migrations No context type was found in the assembly 'Songbirds.Dal.EntityFramework'.
I tried to explicitly specify the context type with the following result:
PM> enable-migrations -ContextTypeName Songbirds.Dal.EntityFramework.SongbirdsDbContext The context type 'Songbirds.Dal.EntityFramework.SongbirdsDbContext' was not found in the assembly 'Songbirds.Dal.EntityFramework'.
SongbirdsDbContext is part of the Songbirds.Dal.EntityFramework project. Any ideas what I did wrong and why this does not recognize the context?
source share