Efcore: The EntityFramework package is not installed on project ''.

Created on 3 Mar 2017  路  8Comments  路  Source: dotnet/efcore

New fresh error then running add-migration from PM console.

PM> add-migration itemguid
The EntityFramework package is not installed on project 'pano'.

"dotnet ef migrations add itemguid" from CMD runs perfectly as usual

Versobe output
Using StartUp project 'pano'.
Using NuGet project 'pano'.
The EntityFramework package is not installed on project 'Krpano'.

project.json
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",

tools
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final",

closed-question

All 8 comments

Microsoft.EntityFrameworkCore.Tools should go in the dependencies section, not tools. (Confusing, I know.)

P.S. It looks like the EF6 command is trying to execute, but having Microsoft.EntityFrameworkCore.Tools installed correctly will warn you about this and tell you how to use the right command.

Hi Brice, many tnks

seems like I having more issues with EF6
PM> add-migration itemguid2 鈥揤erbose
Using StartUp project 'Krpano'.
Using NuGet project 'Krpano'.
The EntityFramework package is not installed on project 'Krpano'.

Can you please have a look at porject.json
` "dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.EntityFrameworkCore.Design": {
"type": "build",
"version": "1.1.0"
},
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"WindowsAzure.Storage": "8.1.1",
"BundlerMinifier.Core": "2.2.306",
"Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.1",
"Microsoft.AspNetCore.Routing": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
"Microsoft.Extensions.Logging": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",
"Telerik.UI.for.AspNet.Core": "*",
"Microsoft.AspNetCore.Session": "1.1.0",
"Magick.NET.Core-Q8": "7.0.4.701",
"Microsoft.AspNetCore.WebSockets": "1.0.0",
"Microsoft.AspNetCore.SignalR.Server": "0.2.0-rtm-22752",
"Hangfire": "1.6.8",
"Microsoft.Extensions.Options": "1.1.0"
},

"tools": {
"Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
"Microsoft.Extensions.SecretManager.Tools": "1.1.0-preview4-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.1.0-preview4-final",
"imports": [
"portable-net45+win8"
]
},
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final",
"BundlerMinifier.Core": "2.2.306"
},`

What does gmo | ft Name, Path show? Does closing and re-opening the solution help?

Year, sorry. Previous error persisted during restart of studio and I didn`t cheked that after removing Microsoft.EntityFrameworkCore.Tools

After restart I see
PM> add-migration itemguid2 鈥揤erbose
Both Entity Framework Core and Entity Framework 6 are installed. The Entity Framework Core tools are running. Use 'EntityFramework\Add-Migration' for Entity Framework 6.
Build started...
Build succeeded.
Setting app base path C:\Users\dima\Source\Repos\pano\src\pano.\bin\Debug\netcoreapp1.0
Finding DbContext classes...
Using context 'ApplicationDbContext'.
Writing migration to 'C:\Users\dima\Source\Repos\pano\src\pano\Migrations20170303201048_itemguid2.cs'.
Writing model snapshot to 'C:\Users\dima\Source\Reposrpano\src\pano\Migrations\ApplicationDbContextModelSnapshot.cs'.
To undo this action, use Remove-Migration.

but I cannot see any EntityFramework reference in project.json. all EntityFrameworkCore

PM> gmo | ft Name

Name

EntityFramework