Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add-Migration Error in Entity Framework Core

I am following Julie Lerman's Getting Started with Entity Framework Core 2.0 tutorial. I have installed Microsoft.EntityFrameworkCore.SqlServer Version 2.0.2. When I try to run add-migration initial (Package Manager Console) in VS 2017 I am obtaining the below error :

System.IO.FileLoadException: Could not load file or assembly 'Microsoft.EntityFrameworkCore.SqlServer, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'Microsoft.EntityFrameworkCore.SqlServer, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' When I run dotnet --version i get 2.1.3. Can anybody help me rectify this error.

Screenshot :

enter image description here

Thanks in Advance.

like image 909
Abhilash D K Avatar asked Nov 07 '22 09:11

Abhilash D K


1 Answers

Following the very same Pluralsight video, I ran into this same problem. After running:

PM> install-package Microsoft.EntityFrameworkCore.SqlServer

with the default project set to SomeUI

I was able to get the add-migration initial to run without any problems at all, after doing so.

like image 121
Montimur Avatar answered Nov 15 '22 05:11

Montimur