jonwagner / Insight.Database

Fast, lightweight .NET micro-ORM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not load type 'SqlGuidCaster' from assembly 'System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because it contains an object field at offset 0 that is incorrectly aligned or overlapped by a non-object field.

m0hamdan opened this issue · comments

Describe the bug

I've upgraded Insight.Database to version 6.3.11 and I've noticed this version is referencing a vulnerable version of System.Data.SqlClient (4.5.0), which is causing the below error upon upgrading to .NET 8.

Could not load type 'SqlGuidCaster' from assembly 'System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because it contains an object field at offset 0 that is incorrectly aligned or overlapped by a non-object field.

Could you please upgrade to the latest version or better yet replace it with Microsoft.Data.SqlClient thanks

Steps to reproduce

1- Create a .NET 8 project
2- Install the latest version of Insight.Database
3- Run AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(assembly => assembly.GetTypes())
.Where(type => !type.IsAbstract && typeof(T).IsAssignableFrom(type))
.Select(type => type.Assembly)
.Distinct()

Expected behavior

  • Dotnet version: [dotnet8]
  • Database: [SQL Server]
  • Library version: [6.3.11]
    Insight Database

dotnet/SqlClient#1930

The package needs to be upgraded

@jonwagner may you please upgrade to support .net 8?

working on this now...

The upgrade8 branch has everything running under .NET8. I'll spend the next day or two going through open issues then I'll do a formal build.

I just pushed the v8.0.0 build out.

I expect some things to break, so I'll keep reviewing the issues log for the next few weeks.

Also need to find time to update the wiki, as a bunch of stuff just died.

but hey at least Postgres is working again :)

Thank you @jonwagner , much appreciated!