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.

SQLGeography column mapping InvalidOperationException

See original GitHub issue

When refreshing our entire database with the new EFCore Power Tools (2.5.966) the following exception is thrown and not generate any function or stored procedure, only the tables:

System.InvalidOperationException: Reverse engineer error: 
System.ArgumentOutOfRangeException: cleanedTypeName: HQDevel_grpc.sys.geography (Parameter 'storeType')
   at SqlDbType RevEng.Core.SqlServerSqlTypeExtensions.GetSqlDbType(string storeType) in C:/Code/EFCorePowerTools/src/GUI/RevEng.Core/Procedures/SqlServerSqlTypeExtensions.cs:line 118
   at Type RevEng.Core.SqlServerSqlTypeExtensions.GetClrType(string storeType, bool isNullable) in C:/Code/EFCorePowerTools/src/GUI/RevEng.Core/Procedures/SqlServerSqlTypeExtensions.cs:line 204
   at Type RevEng.Core.SqlServerSqlTypeExtensions.ClrType(ModuleResultElement moduleResultElement) in C:/Code/EFCorePowerTools/src/GUI/RevEng.Core/Procedures/SqlServerSqlTypeExtensions.cs:line 83
   at void RevEng.Core.Modules.SqlServerRoutineScaffolder.GenerateProperties(List<ModuleResultElement> resultElements, bool nullableReferences) in C:/Code/EFCorePowerTools/src/GUI/RevEng.Core/Routines/SqlServerRoutineScaffolder.cs:line 165
   at void RevEng.Core.Modules.SqlServerRoutineScaffolder.GenerateClass(List<ModuleResultElement> resultElements, string name, bool nullableReferences) in C:/Code/EFCorePowerTools/src/GUI/RevEng.Core/Routines/SqlServerRoutineScaffolder.cs:line 151
   at string RevEng.Core.Modules.SqlServerRoutineScaffolder.WriteResultClass(List<ModuleResultElement> resultElements, ModuleScaffolderOptions options, string name) in C:/Code/EFCorePowerTools/src/GUI/RevEng.Core/Routines/SqlServerRoutineScaffolder.cs:line 136
   at ScaffoldedModel RevEng.Core.Modules.SqlServerRoutineScaffolder.ScaffoldModel(RoutineModel model, ModuleScaffolderOptions scaffolderOptions, ref List<string> errors) in C:/Code/EFCorePowerTools/src/GUI/RevEng.Core/Routines/SqlServerRoutineScaffolder.cs:line 88
   at SavedModelFiles RevEng.Core.ReverseEngineerScaffolder.GenerateStoredProcedures(ReverseEngineerCommandOptions options, ref List<string> errors, ServiceProvider serviceProvider, string outputContextDir, string modelNamespace, string contextNamespace) in C:/Code/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerScaffolder.cs:line 168
   at ReverseEngineerResult RevEng.Core.ReverseEngineerRunner.GenerateFiles(ReverseEngineerCommandOptions options) in C:/Code/EFCorePowerTools/src/GUI/RevEng.Core/ReverseEngineerRunner.cs:line 94
   at int efreveng.Program.Main(string[] args) in C:/Code/EFCorePowerTools/src/GUI/efreveng/Program.cs:line 63

   at ReverseEngineerResult EFCorePowerTools.Handlers.ReverseEngineer.ResultDeserializer.BuildResult(string output)
   at async Task<ReverseEngineerResult> EFCorePowerTools.Handlers.ReverseEngineer.EfRevEngLauncher.GetOutputAsync()
   at async Task<ReverseEngineerResult> 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)
   at async Task EFCorePowerTools.Handlers.ReverseEngineer.ReverseEngineerHandler.ReverseEngineerCodeFirstAsync(Project project, string optionsPath, bool onlyGenerate)

With the previous version 2.5.918 everything is work fine. I can’t reproduce it with my minimal repo like #1368, so please see the code according to the stack, and I pray if something is shown. 😃

Thanks.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ErikEJcommented, May 3, 2022

fixed in latest daily build

0reactions
Dimigergocommented, May 3, 2022

Thank You very much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

The given ColumnMapping does not match up with any ...
InvalidOperationException : The given ColumnMapping does not match up with any column in the source or destination. at System.Data.SqlClient.
Read more >
The given ColumnMapping does not match up with any ...
The problem is with the s.ColumnMappings.Add(column.ToString(), column.ToString()); and mapping of your destination and source tables. At least ...
Read more >
Sql image data type can't be mapped to SqlBinary in ...
Description Having a sql server table with a column image data type is not mapping to SqlBinary and only maps to byte[].
Read more >
Entity Framework Core: System.InvalidOperationException ...
This exception happens when you try to map a type that is not supported by EF Core. Either change the type of the...
Read more >
OracleBulkCopyColumnMapping...
If a ColumnMapping is not specified, then, by default, columns are mapped based on the ordinal position. This succeeds only if the source...
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