Reputation: 1449
I am a .NET student. So please be patient with me. Apart from adding this question here I search web tirelessly to find a solution to my problem. Thank you for understanding.
I am trying to migrate a code-first project with Entity Framework Core just so I can familiarize my self with all the commands and procedures.
The problem I am getting is when a try to migrate. I am writing the line
add-migration Initial-Migration -context BlogContext
in the Package Manager Console. The error I am getting is this one:
These are my dependencies:
{
"dependencies": {
"BundlerMinifier.Core": "2.2.306",
"EntityFramework.Core": "7.0.0-rc1-final",
"Microsoft.ApplicationInsights.AspNetCore": "1.0.2",
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Routing": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "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.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0"
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final"
},
Tell me if there is anything more you would like to see. I am grateful for all the help I get.
EDIT:
New error from VS Package manager Console:
Upvotes: 0
Views: 2187
Reputation: 16795
Remove "EntityFramework.Core": "7.0.0-rc1-final",
dependency (line 3 in listing) - it's old version of Microsoft.EntityFrameworkCore
and it may add some old/undesired libs to you app
Run dotnet restore
from command line (from src/Blogg
folder) to refresh package list (VS should do it automatically, but we need to be sure).
Manually remove bin
and obj
folders
Run dotnet ef migrations add BlogContext
from command line (from src/Blogg
folder)
Upvotes: 1