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.

ArgumentNullException reverse engineering updates to previously reverse engineered SQL database

See original GitHub issue

Trying to update a previously reverse engineered SQL database currently fails. I’d guessed that something changed on the db side that is an edge case and caused the issue. However, before submitting this issue, I tried against another SQL database (which I have been successfully reverse engineering against for some time now), and I experience the same issue. That leads me to suggest it might not be the database. In both cases, the database is a 3rd-party private system that I cannot provide access to.

Provide steps to reproduce

Right click class library project Select “EF Core Power Tools” Select “Reverse Engineer” Select data connection and click “Ok” After a moment, the status bar indicates “An error occurred. See the “Extensions” Output window for details.”

That output is:

System.ArgumentNullException: Value cannot be null. Parameter name: source at bool System.Linq.Enumerable.Any<TSource>(IEnumerable<TSource> source, Func<TSource, bool> predicate) at void EFCorePowerTools.Helpers.ReverseEngineerHelper.AddSuggestedMappings(ReverseEngineerOptions options, List<TableModel> tables)+(TableModel t) => { } at bool System.Linq.Enumerable.Any<TSource>(IEnumerable<TSource> source, Func<TSource, bool> predicate) at void EFCorePowerTools.Helpers.ReverseEngineerHelper.AddSuggestedMappings(ReverseEngineerOptions options, List<TableModel> tables) at async Task<bool> EFCorePowerTools.Handlers.ReverseEngineer.ReverseEngineerHandler.LoadDataBaseObjectsAsync(ReverseEngineerOptions options, DatabaseConnectionModel dbInfo, Tuple<List<Schema>, string> namingOptionsAndPath) at async Task EFCorePowerTools.Handlers.ReverseEngineer.ReverseEngineerHandler.ReverseEngineerCodeFirstAsync(Project project, string optionsPath, bool onlyGenerate, bool fromSqlProj)

This is a .NET 7 class library which data models reverse-engineered from this database. I have periodically refreshed these with the Reverse Engineer tool over the last year or two. However, attempts today to add some additional tables fails before the database object list is displayed. This error occurs whether I select EF Core 7 or EF Core 6 from the “Choose Your Data Connection” dialog.

The database is accessible via Server Explorer, and via LINQPad.

While I cannot provide access to the 3rd-party private database, I am happy to do what I can to help identify which database object is causing the problem.

Provide technical details

  • EF Core version in use: EF Core 7.0.3

  • Is Handlebars used: no

  • Is T4 used: no

  • Is .dacpac used: no

  • EF Core Power Tools version: 2.5.1309 (same issue with previous build)

  • Database engine: Microsoft SQL Server 2019 (RTM-CU18) (KB5017593) - 15.0.4261.1 (X64)

  • Visual Studio version: Visual Studio 2022 17.6.0 Preview 1

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
NutmegAdamcommented, Mar 3, 2023

Done and done - thanks again!

0reactions
ErikEJcommented, Mar 3, 2023

Thanks a lot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reverse engineering failure · Issue #494
... build project then select reverse engineer, select database, click Okay and get. System.ArgumentNullException: Value cannot be null.
Read more >
Reverse engineer an existing database into a ...
Use the Reverse Engineer Wizard in Visio to create a database model from an existing database or Excel spreadsheet.
Read more >
Reverse Engineering Existing Databases with Entity ...
In this short post, we'll explore the process of reverse engineering an existing SQL Server database and how you might apply database ......
Read more >
I get an exception when I try to reverse engineer ...
So I use nuget to install EF Power Tools and I select my project, right click and choose; Entity Framework -> Reverse Engineer...
Read more >
Reverse Engineer Processing Errors
When you reverse engineer a script or a database, parser errors may occur. Parser errors often occur when there is a mismatch between...
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