NullReferenceException when using Reverse Engineering with Handlebars
See original GitHub issueI have this configuration and I already have the CodeTemplates
folder in my project.
Using VS2019, MySQL 8 and EFCorePowerTools 2.4
And I get this result:
System.Exception: Reverse engineer error:
System.NullReferenceException: Object reference not set to an instance of an object.
at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpDbContextGenerator.GenerateRelationship(IForeignKey foreignKey, Boolean useDataAnnotations, IndentedStringBuilder sb)
at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpDbContextGenerator.GenerateEntityType(IEntityType entityType, Boolean useDataAnnotations, IndentedStringBuilder sb)
at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpDbContextGenerator.GenerateOnModelCreating(IModel model, Boolean useDataAnnotations)
at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpDbContextGenerator.GenerateClass(IModel model, String contextName, String connectionString, Boolean useDataAnnotations, Boolean suppressConnectionStringWarning)
at EntityFrameworkCore.Scaffolding.Handlebars.HbsCSharpDbContextGenerator.WriteCode(IModel model, String contextName, String connectionString, String contextNamespace, String modelNamespace, Boolean useDataAnnotations, Boolean suppressConnectionStringWarning)
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 ReverseEngineer20.ReverseEngineer.ReverseEngineerRunner.GenerateFiles(ReverseEngineerCommandOptions reverseEngineerOptions) in C:\Code\EFCorePowerTools\src\GUI\RevEng.Core\ReverseEngineerRunner.cs:line 89
at efreveng.Program.Main(String[] args) in C:\Code\EFCorePowerTools\src\GUI\efreveng\Program.cs:line 57
at EFCorePowerTools.Handlers.ReverseEngineer.ResultDeserializer.BuildResult(String output) in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ReverseEngineer\ResultDeserializer.cs:line 27
at ReverseEngineer20.ReverseEngineer.EfRevEngLauncher.GetOutput() in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ReverseEngineer\EfRevEngLauncher.cs:line 81
at EFCorePowerTools.Handlers.ReverseEngineerHandler.LaunchExternalRunner(ReverseEngineerOptions options, Boolean useEFCore5) in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ReverseEngineerHandler.cs:line 381
at EFCorePowerTools.Handlers.ReverseEngineerHandler.<ReverseEngineerCodeFirst>d__3.MoveNext() in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ReverseEngineerHandler.cs:line 225
Any ideas?
Issue Analytics
- State:
- Created 3 years ago
- Comments:27 (16 by maintainers)
Top Results From Across the Web
Decompile handlebars compiled code to ...
One solution would be to write a function that traverses the compiled code, look for where the HTML is being pushed and then...
Read more >Applied Reverse Engineering: Exceptions and Interrupts
An exception is defined as an event that is generated by the processor when one or more errors are encountered while executing a...
Read more >Error while reverse engineering database from a sql file
I'm trying to reverse engineer a DB in MySql with a sql file generated from an OpenOffice database. while trying to import and...
Read more >Binary Patching. The Brute Force of Reverse Engineering with ...
Let's setup a little C program to reverse engineer (we'll even try to modify it) that simply prints "Hello Null Byte" and waits...
Read more >AlphaGolang | A Step-by-Step Go Malware Reversing ...
SentinelLabs sets off to dispel the myth that Go malware is hard to reverse engineer. This suite of IDApython scripts will set you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Let me check.
Awesome! It works. Thanks for the great tool!