I was working on this asp.net Core application and got this error below while trying to scaffold a new controller as seen below. I suspected the issue happened because I had updated a few packages in the project.
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.
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)
After a quick searching and reading a few post online, I stumbled upon this one post on Stackoverflow where someone had similar issue. So, below you will find exactly what I did to resolve that issue which was very simple.
- I unload the project, Right click the project -> Unload Project
- Next, Right click the unloaded project name and Edit the .csproj file
- Find the ItemGroup section in the .csproj file as seen below and update the following
- Once done updating the versions, right click the project name and reload it. Then, clean the solution and build the project afterwards. If this doesn’t work for you then downgrade to a lower version until you get it to work.