You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am reverse engineering a CEDS database. This worked last year every time I ran it. I am now running it to update my entities.
This year it started with an error which made me choose EF Core 7 on the dropdown on the first page of the dialog. I changed to that and got further but I got the error below. I tried running with both T4 and without. I tried deleting everything, the JSON config file, the entities, the context, etc. I tried removing the entire project and pulling it from GIT. I love your tool. I just need help. Please.
I am working on a DAL project for the solution.
ERROR:
System.InvalidOperationException: Reverse engineer error:
Microsoft.EntityFrameworkCore.Design.OperationException: Processing 'C:\GIT\msi-api\MSI_API.Infrastructure\CodeTemplates\EFCore\DbContext.t4' failed.
at void Microsoft.EntityFrameworkCore.Scaffolding.Internal.TextTemplatingModelGenerator.HandleErrors(TextTemplatingEngineHost host)
at ScaffoldedModel Microsoft.EntityFrameworkCore.Scaffolding.Internal.TextTemplatingModelGenerator.GenerateModel(IModel model, ModelCodeGenerationOptions options)
at ScaffoldedModel RevEng.Core.ReverseEngineerScaffolder.ScaffoldModel(string connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions, bool removeNullableBoolDefaults, bool dbContextOnly, bool entitiesOnly, bool useSchemaFolders) in C:/Code/Github/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerScaffolder.cs:line 375
at SavedModelFiles RevEng.Core.ReverseEngineerScaffolder.GenerateDbContext(ReverseEngineerCommandOptions options, List schemas, string outputContextDir, string modelNamespace, string contextNamespace, string projectPath, string outputPath) in C:/Code/Github/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerScaffolder.cs:line 103
at ReverseEngineerResult RevEng.Core.ReverseEngineerRunner.GenerateFiles(ReverseEngineerCommandOptions options) in C:/Code/Github/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerRunner.cs:line 88
at async Task EfReveng.Program.Main(string[] args) in C:/Code/Github/EFCorePowerTools/src/GUI/efreveng/Program.cs:line 69
at ReverseEngineerResult EFCorePowerTools.Handlers.ReverseEngineer.ResultDeserializer.BuildResult(string output)
at async Task EFCorePowerTools.Handlers.ReverseEngineer.EfRevEngLauncher.GetOutputAsync()
at async Task EFCorePowerTools.Handlers.ReverseEngineer.EfRevEngLauncher.LaunchExternalRunnerAsync(ReverseEngineerOptions options, CodeGenerationMode codeGenerationMode, Project project)
at async Task EFCorePowerTools.Handlers.ReverseEngineer.ReverseEngineerHandler.GenerateFilesAsync(Project project, ReverseEngineerOptions options, Tuple<bool, string> containsEfCoreReference, bool onlyGenerate)
at async Task EFCorePowerTools.Handlers.ReverseEngineer.ReverseEngineerHandler.ReverseEngineerCodeFirstAsync(Project project, string optionsPath, bool onlyGenerate, bool fromSqlProj)
When I run without T4
System.InvalidOperationException: Reverse engineer error:
System.NullReferenceException: Object reference not set to an instance of an object.
at string Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpDbContextGenerator.TransformText()
at string Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpModelGenerator.ProcessTemplate(ITextTransformation transformation)
at ScaffoldedModel Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpModelGenerator.GenerateModel(IModel model, ModelCodeGenerationOptions options)
at ScaffoldedModel RevEng.Core.ReverseEngineerScaffolder.ScaffoldModel(string connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions, bool removeNullableBoolDefaults, bool dbContextOnly, bool entitiesOnly, bool useSchemaFolders) in C:/Code/Github/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerScaffolder.cs:line 375
at SavedModelFiles RevEng.Core.ReverseEngineerScaffolder.GenerateDbContext(ReverseEngineerCommandOptions options, List schemas, string outputContextDir, string modelNamespace, string contextNamespace, string projectPath, string outputPath) in C:/Code/Github/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerScaffolder.cs:line 103
at ReverseEngineerResult RevEng.Core.ReverseEngineerRunner.GenerateFiles(ReverseEngineerCommandOptions options) in C:/Code/Github/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerRunner.cs:line 88
at async Task EfReveng.Program.Main(string[] args) in C:/Code/Github/EFCorePowerTools/src/GUI/efreveng/Program.cs:line 69
at ReverseEngineerResult EFCorePowerTools.Handlers.ReverseEngineer.ResultDeserializer.BuildResult(string output)
at async Task EFCorePowerTools.Handlers.ReverseEngineer.EfRevEngLauncher.GetOutputAsync()
at async Task EFCorePowerTools.Handlers.ReverseEngineer.EfRevEngLauncher.LaunchExternalRunnerAsync(ReverseEngineerOptions options, CodeGenerationMode codeGenerationMode, Project project)
at async Task EFCorePowerTools.Handlers.ReverseEngineer.ReverseEngineerHandler.GenerateFilesAsync(Project project, ReverseEngineerOptions options, Tuple<bool, string> containsEfCoreReference, bool onlyGenerate)
at async Task EFCorePowerTools.Handlers.ReverseEngineer.ReverseEngineerHandler.ReverseEngineerCodeFirstAsync(Project project, string optionsPath, bool onlyGenerate, bool fromSqlProj)
Erik, THANK YOU! That was it! 2 Things I didn’t realize, there was an indicator on the table icon (old eyes missed that detail) and there were “closed” issues.
LOVE your product! Thank you so much for your quick response!
Thank you,
—Larry—
Lawrence Farrell
[signature_1593138464]
1149 Bloomfield Ave. Suite G, Clifton, NJ 07012
C: 551-804-8818
***@***.******@***.***> | sprucetech.com<http://www.sprucetech.com/>
From: Erik Ejlskov Jensen ***@***.***>
Sent: Wednesday, January 18, 2023 5:18 PM
To: ErikEJ/EFCorePowerTools ***@***.***>
Cc: Lawrence Farrell ***@***.***>; Author ***@***.***>
Subject: Re: [ErikEJ/EFCorePowerTools] EF Core Power Tools stopped working in January (Issue #1661)
EXTERNAL SENDER
it is a good idea to search for similar closed issues...
Were you using EF Core 5 before?
See dotnet/efcore#29516<dotnet/efcore#29516> for this issue and workarounds - a fix will be available in mid Feb 2023
—
Reply to this email directly, view it on GitHub<#1661 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A2EIMZZMRRJ374GQUP5WURTWTBTZVANCNFSM6AAAAAAT7TSHZY>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
I am reverse engineering a CEDS database. This worked last year every time I ran it. I am now running it to update my entities.
This year it started with an error which made me choose EF Core 7 on the dropdown on the first page of the dialog. I changed to that and got further but I got the error below. I tried running with both T4 and without. I tried deleting everything, the JSON config file, the entities, the context, etc. I tried removing the entire project and pulling it from GIT. I love your tool. I just need help. Please.
I am working on a DAL project for the solution.
ERROR:
System.InvalidOperationException: Reverse engineer error:
Microsoft.EntityFrameworkCore.Design.OperationException: Processing 'C:\GIT\msi-api\MSI_API.Infrastructure\CodeTemplates\EFCore\DbContext.t4' failed.
at void Microsoft.EntityFrameworkCore.Scaffolding.Internal.TextTemplatingModelGenerator.HandleErrors(TextTemplatingEngineHost host)
at ScaffoldedModel Microsoft.EntityFrameworkCore.Scaffolding.Internal.TextTemplatingModelGenerator.GenerateModel(IModel model, ModelCodeGenerationOptions options)
at ScaffoldedModel RevEng.Core.ReverseEngineerScaffolder.ScaffoldModel(string connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions, bool removeNullableBoolDefaults, bool dbContextOnly, bool entitiesOnly, bool useSchemaFolders) in C:/Code/Github/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerScaffolder.cs:line 375
at SavedModelFiles RevEng.Core.ReverseEngineerScaffolder.GenerateDbContext(ReverseEngineerCommandOptions options, List schemas, string outputContextDir, string modelNamespace, string contextNamespace, string projectPath, string outputPath) in C:/Code/Github/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerScaffolder.cs:line 103
at ReverseEngineerResult RevEng.Core.ReverseEngineerRunner.GenerateFiles(ReverseEngineerCommandOptions options) in C:/Code/Github/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerRunner.cs:line 88
at async Task EfReveng.Program.Main(string[] args) in C:/Code/Github/EFCorePowerTools/src/GUI/efreveng/Program.cs:line 69
at ReverseEngineerResult EFCorePowerTools.Handlers.ReverseEngineer.ResultDeserializer.BuildResult(string output)
at async Task EFCorePowerTools.Handlers.ReverseEngineer.EfRevEngLauncher.GetOutputAsync()
at async Task EFCorePowerTools.Handlers.ReverseEngineer.EfRevEngLauncher.LaunchExternalRunnerAsync(ReverseEngineerOptions options, CodeGenerationMode codeGenerationMode, Project project)
at async Task EFCorePowerTools.Handlers.ReverseEngineer.ReverseEngineerHandler.GenerateFilesAsync(Project project, ReverseEngineerOptions options, Tuple<bool, string> containsEfCoreReference, bool onlyGenerate)
at async Task EFCorePowerTools.Handlers.ReverseEngineer.ReverseEngineerHandler.ReverseEngineerCodeFirstAsync(Project project, string optionsPath, bool onlyGenerate, bool fromSqlProj)
When I run without T4
System.InvalidOperationException: Reverse engineer error:
System.NullReferenceException: Object reference not set to an instance of an object.
at string Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpDbContextGenerator.TransformText()
at string Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpModelGenerator.ProcessTemplate(ITextTransformation transformation)
at ScaffoldedModel Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpModelGenerator.GenerateModel(IModel model, ModelCodeGenerationOptions options)
at ScaffoldedModel RevEng.Core.ReverseEngineerScaffolder.ScaffoldModel(string connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions, bool removeNullableBoolDefaults, bool dbContextOnly, bool entitiesOnly, bool useSchemaFolders) in C:/Code/Github/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerScaffolder.cs:line 375
at SavedModelFiles RevEng.Core.ReverseEngineerScaffolder.GenerateDbContext(ReverseEngineerCommandOptions options, List schemas, string outputContextDir, string modelNamespace, string contextNamespace, string projectPath, string outputPath) in C:/Code/Github/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerScaffolder.cs:line 103
at ReverseEngineerResult RevEng.Core.ReverseEngineerRunner.GenerateFiles(ReverseEngineerCommandOptions options) in C:/Code/Github/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerRunner.cs:line 88
at async Task EfReveng.Program.Main(string[] args) in C:/Code/Github/EFCorePowerTools/src/GUI/efreveng/Program.cs:line 69
at ReverseEngineerResult EFCorePowerTools.Handlers.ReverseEngineer.ResultDeserializer.BuildResult(string output)
at async Task EFCorePowerTools.Handlers.ReverseEngineer.EfRevEngLauncher.GetOutputAsync()
at async Task EFCorePowerTools.Handlers.ReverseEngineer.EfRevEngLauncher.LaunchExternalRunnerAsync(ReverseEngineerOptions options, CodeGenerationMode codeGenerationMode, Project project)
at async Task EFCorePowerTools.Handlers.ReverseEngineer.ReverseEngineerHandler.GenerateFilesAsync(Project project, ReverseEngineerOptions options, Tuple<bool, string> containsEfCoreReference, bool onlyGenerate)
at async Task EFCorePowerTools.Handlers.ReverseEngineer.ReverseEngineerHandler.ReverseEngineerCodeFirstAsync(Project project, string optionsPath, bool onlyGenerate, bool fromSqlProj)
Provide steps to reproduce
{
"CodeGenerationMode": 3,
"ContextClassName": "MSIContext",
"ContextNamespace": null,
"DefaultDacpacSchema": null,
"FilterSchemas": false,
"IncludeConnectionString": false,
"ModelNamespace": null,
"OutputContextPath": "Context",
"OutputPath": "Entities",
"PreserveCasingWithRegex": true,
"ProjectRootNamespace": "MSI_API.Infrastructure",
"Schemas": null,
"SelectedHandlebarsLanguage": 2,
"SelectedToBeGenerated": 0,
"Tables": [
{
"Name": "[clean].[Location]",
"ObjectType": 0
},
{
"Name": "[clean].[Organization]",
"ObjectType": 0
},
/* etc etc */
],
"UiHint": "ES00vDADOSQL109.MSI",
"UncountableWords": null,
"UseBoolPropertiesWithoutDefaultSql": false,
"UseDatabaseNames": true,
"UseDateOnlyTimeOnly": false,
"UseDbContextSplitting": false,
"UseFluentApiOnly": false,
"UseHandleBars": false,
"UseHierarchyId": false,
"UseInflector": true,
"UseLegacyPluralizer": false,
"UseManyToManyEntity": false,
"UseNoDefaultConstructor": false,
"UseNoObjectFilter": false,
"UseNodaTime": false,
"UseNullableReferences": false,
"UseSchemaFolders": false,
"UseSpatial": false,
"UseT4": true
}
Please include a complete description or project that I can redo/run to reproduce the issue.
Provide technical details
EF Core version in use: 7
Is Handlebars used: no/yes - false
Is T4 used: - true
Is .dacpac used: no/yes
EF Core Power Tools version: 2.5.1267
Database engine: SQL Server
Visual Studio version: Visual Studio 2022
The text was updated successfully, but these errors were encountered: