Skip to content
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

Add | Add net8 compatibility #1934

Merged
merged 2 commits into from Jun 6, 2023

Conversation

Wraith2
Copy link
Contributor

@Wraith2 Wraith2 commented Feb 26, 2023

closes #1930

In netcore builds SqlGuidCaster and the type workaround that used it are not required. The problem they solved has already been change to use the ReadOnlySpan ctor. The SqlGuid workarounds in netcore are removed. Netfx builds use a more recent approach to the original problem and do not need to change.

I have also added ifdeffed use of the new api's introduced to the ryntime in dotnet/runtime#72724 so if/when a net8 build is created the new methods will be used and the workarounds will be ifdeffed out entirely.

Testing on net was done manually with a small repro app that used reflection to force SqlGuidCaster to be compiled. Before these change the reported TypeLoadException was encountered, after them it is not.

/cc @Alerinos @MichalPetryka

@JRahnama
Copy link
Member

JRahnama commented May 3, 2023

I will do some changes to this PR, such as the csproj file to include SqlTypeWorkarounds to be included if it is net6 only and changing the Net 8 to net 7 for now.

@JRahnama JRahnama added this to the 5.2.0-preview2 milestone May 3, 2023
@Wraith2
Copy link
Contributor Author

Wraith2 commented May 3, 2023

You can't change the net8 to 7 because this is adding support for new apis that aren't in 7. For the rest, go ahead.

@codecov
Copy link

codecov bot commented May 8, 2023

Codecov Report

Patch coverage: 45.45% and project coverage change: -0.16 ⚠️

Comparison is base (a4f18ca) 70.82% compared to head (37fb9a0) 70.67%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1934      +/-   ##
==========================================
- Coverage   70.82%   70.67%   -0.16%     
==========================================
  Files         292      305      +13     
  Lines       61777    61794      +17     
==========================================
- Hits        43752    43670      -82     
- Misses      18025    18124      +99     
Flag Coverage Δ
addons 92.88% <ø> (+0.49%) ⬆️
netcore 73.43% <45.45%> (-1.01%) ⬇️
netfx 69.27% <ø> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...rosoft/Data/SqlTypes/SqlTypeWorkarounds.netcore.cs 94.73% <ø> (+12.91%) ⬆️
...c/Microsoft/Data/SqlClient/Server/ValueUtilsSmi.cs 64.16% <ø> (ø)
...qlClient/src/Microsoft/Data/SqlClient/SqlBuffer.cs 80.45% <ø> (ø)
.../netcore/src/Microsoft/Data/SqlClient/TdsParser.cs 68.58% <45.45%> (-4.81%) ⬇️

... and 93 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@David-Engel
Copy link
Contributor

You can't change the net8 to 7 because this is adding support for new apis that aren't in 7. For the rest, go ahead.

The new APIs made it into .net7 last year. I think we are good to go on this PR.
https://github.com/dotnet/runtime/commits/v7.0.0/src/libraries/System.Data.Common/src/System/Data/SQLTypes

@DavoudEshtehari DavoudEshtehari added the 💡 Enhancement New feature request label Jun 6, 2023
@DavoudEshtehari DavoudEshtehari added this to In progress in SqlClient v5.2 via automation Jun 6, 2023
@DavoudEshtehari DavoudEshtehari merged commit 288a70c into dotnet:main Jun 6, 2023
132 checks passed
SqlClient v5.2 automation moved this from In progress to Done Jun 6, 2023
@JRahnama JRahnama changed the title Add net8 compatibility Add | Add net8 compatibility Jun 7, 2023
kant2002 pushed a commit to kant2002/SqlClient that referenced this pull request Jun 29, 2023
wilbit added a commit to Intrigma/SqlClient that referenced this pull request Jan 19, 2024
wilbit added a commit to Intrigma/SqlClient that referenced this pull request Jan 19, 2024
wilbit added a commit to Intrigma/SqlClient that referenced this pull request Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Enhancement New feature request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Could not load type 'SqlGuidCaster' from assembly Microsoft.Data.SqlClient
5 participants