Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.InvalidOperationException: Reverse engineer error: #1676

Closed
ManMog opened this issue Jan 31, 2023 · 1 comment
Closed

System.InvalidOperationException: Reverse engineer error: #1676

ManMog opened this issue Jan 31, 2023 · 1 comment
Labels
duplicate This issue or pull request already exists question Further information is requested

Comments

@ManMog
Copy link

ManMog commented Jan 31, 2023

Exception thrown when trying to reverse engineer from a mysql 5.7 databaseand targeting EF Core 7.

Output:
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)

Steps to reproduce
Simply reverse engineer a database project with EF Core 7 as the target using version 2.5.1277

  • EF Core version: EF Core 7

  • Is T4 used: yes

  • Is Handlebars used: no/yes

  • Is .dacpac used: no

  • EF Core Power Tools version: 2.5.1277

  • Database engine: MySQL

  • Visual Studio version: Visual Studio 2022 Versión 17.4.4

@ErikEJ
Copy link
Owner

ErikEJ commented Jan 31, 2023

duplicate - see dotnet/efcore#29516 - fix will be available in EF Core Power Tools in mid February

@ErikEJ ErikEJ closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2023
@ErikEJ ErikEJ added question Further information is requested duplicate This issue or pull request already exists labels Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants