dotnet / SqlClient

Microsoft.Data.SqlClient provides database connectivity to SQL Server for .NET applications.
MIT License
859 stars 288 forks source link

Add support for .NET 9 #2946

Open mdaigle opened 3 weeks ago

mdaigle commented 3 weeks ago

Opening this up to get CI running on it. Duplicating #2674 to have my own workspace.

David-Engel commented 2 weeks ago

Am curious - is there any net9.0 API that's actually needed/used? If not, is there a specific reason to add the net9.0 TFM?

@roji JSON support in SqlDbType: https://github.com/dotnet/runtime/issues/103925

roji commented 2 weeks ago

@David-Engel of course, I forgot about that, thanks :)

MichelZ commented 23 hours ago

You should be able to add:

- task: UseDotNet@2
  displayName: 'Use .NET 9.x sdk'
  inputs:
    packageType: sdk
    version: '9.x'
    installationPath: $(Agent.ToolsDirectory)/dotnet

- task: UseDotNet@2
  displayName: 'Install .NET 8.x runtime'
  inputs:
    packageType: runtime
    version: '8.x'
    installationPath: $(Agent.ToolsDirectory)/dotnet

Before this line, as a first step: https://github.com/dotnet/SqlClient/blob/8d500a3c63c6f2d57edb67a31f21aa6346581741/eng/pipelines/common/templates/steps/ci-project-build-step.yml#L37

That should get the build going. You probably need to cache a few more packages in the "official" feed.

Have a look at my attempt on getting it to work

mdaigle commented 19 hours ago

You should be able to add:

- task: UseDotNet@2
  displayName: 'Use .NET 9.x sdk'
  inputs:
    packageType: sdk
    version: '9.x'
    installationPath: $(Agent.ToolsDirectory)/dotnet

- task: UseDotNet@2
  displayName: 'Install .NET 8.x runtime'
  inputs:
    packageType: runtime
    version: '8.x'
    installationPath: $(Agent.ToolsDirectory)/dotnet

Before this line, as a first step:

https://github.com/dotnet/SqlClient/blob/8d500a3c63c6f2d57edb67a31f21aa6346581741/eng/pipelines/common/templates/steps/ci-project-build-step.yml#L37

That should get the build going. You probably need to cache a few more packages in the "official" feed.

Have a look at my attempt on getting it to work

Thanks @MichelZ, I'll give that a shot. I had issues previously with the sdk version resolver picking up the .NET 9 rc version when installing that way, but it may be working better now with the GA version available.

codecov[bot] commented 10 hours ago

Codecov Report

Attention: Patch coverage is 35.71429% with 9 lines in your changes missing coverage. Please review.

Project coverage is 72.80%. Comparing base (b1f7eaf) to head (fe363e2). Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...c/Microsoft/Data/SqlClient/Server/SqlNormalizer.cs 0.00% 9 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2946 +/- ## ========================================== + Coverage 72.68% 72.80% +0.12% ========================================== Files 285 285 Lines 59155 59162 +7 ========================================== + Hits 42998 43075 +77 + Misses 16157 16087 -70 ``` | [Flag](https://app.codecov.io/gh/dotnet/SqlClient/pull/2946/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | Coverage Δ | | |---|---|---| | [addons](https://app.codecov.io/gh/dotnet/SqlClient/pull/2946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `92.58% <ø> (ø)` | | | [netcore](https://app.codecov.io/gh/dotnet/SqlClient/pull/2946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `75.52% <35.71%> (+0.13%)` | :arrow_up: | | [netfx](https://app.codecov.io/gh/dotnet/SqlClient/pull/2946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `71.19% <30.76%> (+0.06%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: