3

I am trying to add an MVC Controller with views, using Entity Framework to my ASP.NET Core Web application project in VS 2017. However when I do it the following error occurs:

Method not found: 'Void Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations..ctor(Microsoft.EntityFrameworkCore.Design.Internal.IOperationReporter, System.Reflection.Assembly, System.Reflection.Assembly)'.
 at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.<BuildCommandLine>b__6_0()
 at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
 at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.Execute(String[] args)
 at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)

Other controllers I can add, but not this one. I have set up the models around my database using pomelo.

Does anybody have any idea about what this error means and how to resolve it? I completely new to ASP.NET so any hint in the right direction would be much appreciated.

  • 1
    I've found that in these scenarios often reinstalling EF might just work. It probably can be many things, but reinstall EF and see if that helps. – Mirko Acimovic May 30 '18 at 16:42
  • What version of Pomelo are you using? Stick with [2.0.1](https://www.nuget.org/packages/Pomelo.EntityFrameworkCore.MySql/2.0.1) as there is no support for EF Core 2.1 right now. – Mark G May 30 '18 at 17:41

0 Answers0