ArgumentNullException reverse engineering updates to previously reverse engineered SQL database
See original GitHub issueTrying 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:
- Created 7 months ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Done and done - thanks again!
Thanks a lot!