Using Entity Framework 5.0.0 RC / EF 5.x DbContext Generator for C # / Visual Studio 2012 RC / .NET 4.0, I am trying to include automatic migrations in my project. I ran enable-migrationsin the package manager console:
PM> enable-migrations
No classes deriving from DbContext found in the current project.
Edit the generated Configuration class to specify the context to enable migrations for.
Code First Migrations enabled for project Test.
As you can see, it does not automatically detect my DbContext derived type, but I decided it's easy enough, this type of entering a name in the generated code file Migrations/Configuration.cs.
However, in the next step, the package manager console command enable-migrationscrashes because the migration configuration type added by the previous step was not found.
PM> add-migration Initial
No migrations configuration type was found in the assembly 'Test'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).
How can i solve this?
EDIT: , -ConfigurationTypeName:
PM> add-migration -ConfigurationTypeName Test.Migrations.Configuration Initial
The type 'Configuration' is not a migrations configuration type.
, , , , add-migration , .. , Test.Migrations.Configuration . - , , , enable- migrations? . (UserModelContainer DbContext):
namespace Test.Migrations
{
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;
using Test.Models;
internal sealed class Configuration : DbMigrationsConfiguration<UserModelContainer>
{
public Configuration()
{
AutomaticMigrationsEnabled = false;
}
protected override void Seed(UserModelContainer context)
{
}
}
}