Ian Forsyth
Ian Forsyth

Reputation: 31

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

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.

Upvotes: 0

Views: 3215

Answers (3)

ATIF
ATIF

Reputation: 1

You need to add Package in order to get it it working , i have resolved my issue using this. Install-Package Microsoft.EntityFrameworkCore.Tools -Version 3.1.9 as per https://learn.microsoft.com/en-gb/aspnet/core/data/ef-mvc/migrations?view=aspnetcore-3.1#pmc

Upvotes: 0

Andrii Tsok
Andrii Tsok

Reputation: 1446

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

Upvotes: 1

Thom Kiesewetter
Thom Kiesewetter

Reputation: 7304

No, not yet. You should use the new dnx command form the command prompt see dnx ef --help for more information

Be sure you run dnvm use to set the correct dnx version

Upvotes: 0

Related Questions