microsoft / microsoft/sqlmanagementobjects
net8.0 + Microsoft.Data.SqlClient <5.2.0 incompatibility
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 143
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
Microsoft.SqlServer.SqlManagementObjects 171.30.0 depends on Microsoft.Data.SqlClient 5.1.4. Upgrading a tests project from net6.0 to net8.0 produces the following exception
OneTimeSetUp: System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types.
Could not load type 'SqlGuidCaster' from assembly 'Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5' because it contains an object field at offset 0 that is incorrectly aligned or overlapped by a non-object field.
----> System.TypeLoadException : Could not load type 'SqlGuidCaster' from assembly 'Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5' because it contains an object field at offset 0 that is incorrectly aligned or overlapped by a non-object field.
Upgrading to Microsoft.Data.SqlClient 5.2.0 fixes the issue, as documented here: https://github.com/dotnet/SqlClient/issues/1930
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the tests project and its Microsoft.SqlServer.SqlManagementObjects dependency. Reproduce the net8.0 test startup failure with Microsoft.Data.SqlClient 5.1.4, then verify that using version 5.2.0 allows the tests to load successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100