1
votes

I'm trying to add a migration for a .net core 2.0 web app through the package manager console in visual studio 2017. I receive the error: "The EntityFramework package is not installed on project ". However, EntityFrameworkCore 2.0 is installed.

I've tried:

  • the enable-migrations command (although I don't believe this is necessary anymore)
  • the add-migration command
  • "Install-Package Microsoft.EntityFrameworkCore.SqlServer -Version 2.0.0" through the PMC
  • re-installing entityframeworkcore 2.0 through the NuGet package manager

Is there some other configuration that needs to be done somewhere else?

Since EF Core migrations work on my .Net Core 1.1 project could this issue be related to .Net Core 2.0?

Cheers!

3
Odd - I assume you've installed the 2.0 SDK? microsoft.com/net/download/core - Steve Land
Yes, I updated Visual Studio then downloaded the 2.0 SDK and started a new project. - stalemate
please provide your project's *.csproj file - Ph0en1x
Do you have only 1 project in solution or your EF is installed in separate data project? - Smit

3 Answers

1
votes

It looks like the EF6 commands are running. You can unload them with the following command.

Remove-Module EntityFramework

The EF Core PMC commands should be available to use after installing the following package.

Install-Package Microsoft.EntityFrameworkCore.Tools
0
votes

The EF tools for the command-line interface (CLI) are provided in Microsoft.EntityFrameworkCore.Tools.DotNet.

from https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/migrations

0
votes

I spent hours for this issue and finally update Visual Studio 2017 15.4.0 Preview 2.

Hope this help.