There was an error running the selected code generator: Could not load file or assembly Microsoft.EntityFrameworkCore, version = 2.0.1.0
Solution 1
I updated the Microsoft.AspNetCore.All
to version 2.0.3
and now it does work right.
Solution 2
Go to NugetPackage Manager and update the Microsoft.AspNetCore.All package
Solution 3
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" />
Solution 4
Update your packages or it can happen when you have an older SDK. Download a new .NET Core SDK and runtime from www.microsoft.com/net
Related videos on Youtube
x19
Updated on June 04, 2022Comments
-
x19 almost 2 years
When I was creating a
Controller
and aView
byMVC 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
Creating MVC Controller with views, using Entity Framework:
How can I solve this problem?
I use
Visual Studio Version 15.5.2
and version ofMicrosoft.AspNetCore.All
is2.0.0
-
George Wurthmann almost 5 yearsWorks, but I needed to close my solution, reopen and build before Scaffolding again.
-
Trinidad almost 4 yearsSame solution works also in 2019 when adding a scaffolded item and dotnet-aspnet-codegenerator-design.dll throws "The located assembly's manifest definition does not match the assembly reference". Just add those packages in their relevant version to your solution.