0

I'm having a problem adding a controller to my project. Initially, I was getting the error described here: There was an error running the selected code generator: Could not load file or assembly Microsoft.EntityFrameworkCore, version = 2.0.1.0

The suggested solution is to update AspNetCore.All in Nuget. I tried this, failed, and then updated EFCore to 3.0. Since my original post, I've managed to upgrade to ASP.net core 2.1 and reverted EF to 2.2. However, the error I'm getting on adding a controller is the same:

There was an error running the selected code generator Method not found: 'Void >Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations..ctor Microsoft.EntityFrameworkCore.Design.Internal.IOperationReporter, System.Reflection.Assembly, System.Reflection.Assembly)'.

The project builds OK, and runs OK in debug mode.

Is there an easy solution to this, or do I need to downgrade EFCore (how?), or build controllers by hand from now on?

Lucy
  • 410
  • 4
  • 9
  • As far as I remember the upgrade guidelines for .net core 2.0 to 2.2 specify that you should remove the version from AspNetCore.All manually from the project file and let it auto version – Marie Jan 03 '19 at 18:04
  • I hadn't thought of checking the upgrade guidelines :-) I've now upgraded to .net core 2.1 and reverted ef core to 2.2 (post updated). Thankyou. – Lucy Jan 04 '19 at 14:39
  • Problem solved! by lengthy trail and error of various combinations of versions of aspNetCore.All and EntityFramework.Tools – Lucy Jan 04 '19 at 18:46

0 Answers0