Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There was an error running the selected code generator: Could not load file or assembly Microsoft.EntityFrameworkCore, version = 2.0.1.0

When I was creating a Controller and a View by MVC Controller with views, using Entity Framework I got an error.

The Error is:

There was an error running the selected code generator: 'Could not load file or assembly Microsoft.EntityFrameworkCore, version = 2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' the located assembly's manifest definition does not match the assembly reference The error image

Creating MVC Controller with views, using Entity Framework: Creating MVC Controller with views, using Entity Framework

How can I solve this problem?

I use Visual Studio Version 15.5.2 and version of Microsoft.AspNetCore.All is 2.0.0

like image 822
Roohi Avatar asked Jan 03 '18 16:01

Roohi


2 Answers

For me none of the above solutions worked. I had to add Microsoft.EntityFrameworkCore and Microsoft.EntityFrameworkCore.Design packages even though I have Microsoft.AspNetCore.All package added to my project.

Edit project in VS 2017 and add these lines

<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" /> 
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.3" />
like image 58
Crennotech Avatar answered Sep 25 '22 15:09

Crennotech


I updated the Microsoft.AspNetCore.All to version 2.0.3 and now it does work right.

like image 31
Roohi Avatar answered Sep 24 '22 15:09

Roohi