0

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.

2
  • EntityFramework 7 detailed docs and practice examples that you can follow ef.readthedocs.org/en/latest/getting-started/aspnet5.html Commented Nov 2, 2015 at 9:18
  • It looks like the Entity Framework 6 commands are running... does your solution have both? Commented Nov 2, 2015 at 18:21

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.