Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
m0hamdan opened this issue Mar 27, 2024 · 6 comments

Comments

@m0hamdan
Copy link

m0hamdan commented Mar 27, 2024

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
@m0hamdan m0hamdan changed the title Vulnerable package referenced System.Data.SqlClient 4.5.0 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. Mar 28, 2024
@MoeHamdan
Copy link

dotnet/SqlClient#1930

The package needs to be upgraded

@MoeHamdan
Copy link

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

@jonwagner
Copy link
Owner

working on this now...

@jonwagner
Copy link
Owner

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
Copy link
Owner

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
Copy link
Author

Thank you @jonwagner , much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants