The EntityFramework package is not installed on project ASP.NET Beta8

asp.net-core entity-framework-core visual-studio-2015

Question

Trying to get Entity Framework 7 to work in my ASP.NET 5 Beta8 project. I have references to EntityFramework.SqlServer 7.0.0-beta8 and EntityFramework.Commands 7.0.0-beta8 packages in my references.

Yet when I go to the Nuget Package Manager Console and type:

Enable-Migrations

The EntityFramework package is not installed on project "My Project"

And Add-Migration

Add-Migration InitialMigration

The EntityFramework package is not installed on project "My Project"

The default project in the console is set to the correct project.

Popular Answer

The migrations experience in ASP.NET 5 is still a work-in-progress. The following steps are overly complex and will be simplified by the time we reach a stable release.

Now that you have a model, you can use migrations to create a database for you.

  1. Open a command prompt (Windows Key + R, type cmd, click OK)
  2. Use the cd command to navigate to the project directory
  3. Run dnvm use 1.0.0-beta8
  4. Run dnx ef migrations add MyFirstMigration to scaffold a migration to create the initial set of tables for your model.
  5. Run dnx ef database update to apply the new migration to the database.

Because your database doesn’t exist yet, it will be created for you before the migration is applied.

Source: Entity Framework 7 documentation



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why