EFCorePowerTools: Method not found: IServiceCollection AddHandlebarsScaffolding

Hi! Great tool, I use it daily for updating my model from db changes. It’s the best one I’ve used so far. From some days ago, I’m unable to reverse engineer my db. I get the following exception when I try to do so:

System.MissingMethodException: Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.EntityFrameworkCore.Design.ServiceCollectionExtensions.AddHandlebarsScaffolding(Microsoft.Extensions.DependencyInjection.IServiceCollection, Microsoft.EntityFrameworkCore.Design.ReverseEngineerOptions, System.ValueTuple`2<System.String,System.Action`3<System.IO.TextWriter,System.Object,System.Object[]>>[])'.
   at ReverseEngineer20.EfCoreReverseEngineer.GenerateFiles(ReverseEngineerOptions reverseEngineerOptions)
   at EFCorePowerTools.Handlers.ReverseEngineerHandler.<ReverseEngineerCodeFirst>d__2.MoveNext() in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ReverseEngineerHandler.cs:line 153

from the looks of it, it is similar to issue #35

Steps to reproduce

I guess the error started happening when I uninstalled another related tool, but to be honest, I really don’t know, so I’m asking for help. This my guess of the steps that would cause it again:

  1. install https://github.com/ErikEJ/SqlCeToolbox
  2. install https://github.com/ErikEJ/EFCorePowerTools
  3. uninstall SqlCeToolbox
  4. right click on project
  5. select ef core power tools -> reverse engineer
  6. click ok in the next 3 modals until the model generation is triggered
  7. The exception is shown on the output window

First I used sqlcetoolbox for a few months. then I had to stop using it due to project requirements, so I went to using the old scaffold-dbcontext. After some months I came across efcorepowertools which made us very happy for some months. and now I’m having this issue. I hope I can go back to using it soon!

Further technical details

EF Core Power Tools version: Version 1.0.612.0

SQL Server Compact 4.0 in GAC - Yes - 4.0.8876.1 SQL Server Compact 4.0 DbProvider - Yes

SQL Server Compact 4.0 DDEX provider - No SQL Server Compact 4.0 Simple DDEX provider - Yes

SQLite ADO.NET Provider included: 1.0.107.0 SQLite EF6 DbProvider in GAC - No

System.Data.SQLite DDEX provider - No SQLite Simple DDEX provider - Yes

Database engine: SQL Server

Visual Studio version: Visual studio enterprise 2017 version 15.6.6

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 63 (44 by maintainers)

Most upvoted comments

Daily build 629. Model generated successfully!

@rsnider Yes, but it has no handlebars 😦

@tonysneed Great!

I have attached a preview build with Handlebars disabled here, for you all to try out.

EFCorePowerTools.1.0.623.vsix.zip

I am clueless atm, will try a daily build with no Handlebars support soon

Your project is not related to this issue, it is a VS / EF Core Power Tools issue only.

I have no idea what is going on, TBH. Try removing the extension folder, restart VS and install EF Core Power Tools.