Closed MaxIliashenko closed 1 week ago
After updating my .NET and EF Core to version 9, the scaffolding is broken
My scaffolding code is
var scaffold = CreateMssqlScaffolder(navProperties); var dbOpts = new DatabaseModelFactoryOptions(tables: tables); var modelOpts = new ModelReverseEngineerOptions() { UseDatabaseNames = true }; var codeGenOpts = new ModelCodeGenerationOptions { RootNamespace = appNamespace, ContextName = "AppDbContext", ContextNamespace = $"{appNamespace}.EfEntities", ModelNamespace = $"{appNamespace}.EfEntities", SuppressConnectionStringWarning = true, UseDataAnnotations = true, UseNullableReferenceTypes = true }; var scaffoldedModelSources = scaffold.ScaffoldModel(connectionString, dbOpts, modelOpts, codeGenOpts); scaffoldedModelSources .AdditionalFiles .ToList() .ForEach(file => file.Path = Path.Combine("EFModel", file.Path));
Method not found: 'Void Microsoft.EntityFrameworkCore.Scaffolding.ScaffoldedFile..ctor()'. at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpModelGenerator.GenerateModel(IModel model, ModelCodeGenerationOptions options) at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions) at DBP.Server.Designer.DBPAppGenerator.DBPAppDbContext.GenerateDbContext(String connectionString, String[] tables, List`1 navProperties) in C:\Projects\dbp\Server\Designer\DBPAppGenerator\DBPAppDbContext.cs:line 42
EF Core version: 9.0.0 Database provider: Microsoft.EntityFrameworkCore.SqlServer Target framework: .NET 9.0 Operating system: Windows 11 IDE: JetBrains Rider 2024.3
Found it. We're using library https://github.com/TrackableEntities/EntityFrameworkCore.Scaffolding.Handlebars It's not updated to .NET 9
File a bug
After updating my .NET and EF Core to version 9, the scaffolding is broken
Include your code
My scaffolding code is
Include stack traces
Include provider and version information
EF Core version: 9.0.0 Database provider: Microsoft.EntityFrameworkCore.SqlServer Target framework: .NET 9.0 Operating system: Windows 11 IDE: JetBrains Rider 2024.3