question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullReferenceException when using Reverse Engineering with Handlebars

See original GitHub issue

I have this configuration and I already have the CodeTemplates folder in my project.

image

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:closed
  • Created 3 years ago
  • Comments:27 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
tonysneedcommented, Aug 14, 2020

Let me check.

0reactions
hanselsencommented, Aug 18, 2020

Awesome! It works. Thanks for the great tool!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found