jonwagner / Insight.Database

Fast, lightweight .NET micro-ORM
Other
856 stars 145 forks source link

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. #507

Closed m0hamdan closed 4 months ago

m0hamdan commented 5 months ago

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

MoeHamdan commented 5 months ago

https://github.com/dotnet/SqlClient/issues/1930

The package needs to be upgraded

MoeHamdan commented 5 months ago

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

jonwagner commented 4 months ago

working on this now...

jonwagner commented 4 months ago

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.

jonwagner commented 4 months ago

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 :)

m0hamdan commented 4 months ago

Thank you @jonwagner , much appreciated!