1

I'm building a Razor Page app using ASP.NET 2017. When I run the command

dotnet aspnet-codegenerator razorpage -m Activity -dc CongContext -udl -outDir Page\Activities --referenceScriptLibraries

This error appears:

Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I stopped and restarted VS, I've also cleaned and build the solution. Attached jpg shows the code I typed and the results

Flakes
  • 2,422
  • 8
  • 28
  • 32
ATA
  • 39
  • 6

1 Answers1

1

This is because of different versions of packages. Check the 'Dependencies' node of your project. The Microsoft.EntityFrameworkCore and Microsoft.EntityFrameworkCore.Design must have same 2.0.3 versions.

If not, delete and re-add them from [Tools] menu > [Nuget Package Manager]. Also delete the Migrations folder and repeat instructions as listed here. For more info, you may take a look at this comment

S.Serpooshan
  • 7,608
  • 4
  • 33
  • 61
  • Your answer put me on the right track the problem is resolved. Much appreciated! – ATA May 29 '18 at 14:23