-
Notifications
You must be signed in to change notification settings - Fork 316
Adding support for .NET 10 #3686
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
src/Microsoft.Data.SqlClient/tests/UnitTests/TdsParserInternalsTest.cs
Outdated
Show resolved
Hide resolved
...crosoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your best bet will be to update the pipelines to install the .NET 10 SDK (instead of .NET 9 SDK), and ensure that we use .NET 10 SDK to build and run the test projects.
The driver projects must remain using .NET 9 SDK to build.
Hmm... I don't think we can separate this out in our current pipelines. Let's just use the .NET 10 SDK for everything and see how it goes.
.../AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj
Outdated
Show resolved
Hide resolved
...crosoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj
Outdated
Show resolved
Hide resolved
...osoft.Data.SqlClient/tests/PerformanceTests/Microsoft.Data.SqlClient.PerformanceTests.csproj
Show resolved
Hide resolved
@paulmedynski I've been thinking about this. We can start publishing a .NET 10 dll with only a minor version bump. Maybe we target our spring 7.1 release for that addition. At that point it should be better supported in all the build tooling. |
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/Directory.Packages.props:49
- The condition for Microsoft.Extensions.Hosting should be updated to include net10.0, similar to the other updated conditions in this file. Currently, net10.0 builds will fall into the 'not equal' condition on line 53, which may not be the intended behavior given the pattern established elsewhere in this file.
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
/azp run |
|
Azure Pipelines failed to run 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines failed to run 2 pipeline(s). |
src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj
Outdated
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines failed to run 2 pipeline(s). |
paulmedynski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be nice to expirment with the workaround documented here to see if we can eliminate the ensure-dotnet-version.yml template:
microsoft/azure-pipelines-tasks#16501 (comment)
And the alternate way to determine architecture here:
microsoft/azure-pipelines-tasks#20300 (comment)
That would de-clutter the job steps that look like we're repeatedly trying to install SDKs and remove our PowerShell foo.
eng/pipelines/common/templates/steps/build-all-configurations-signed-dlls-step.yml
Outdated
Show resolved
Hide resolved
...sts/tools/Microsoft.Data.SqlClient.ExtUtilities/Microsoft.Data.SqlClient.ExtUtilities.csproj
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj
Outdated
Show resolved
Hide resolved
|
Any progress here now that .NET 10 is GA? |
|
@Frulfump What are you missing in order to use SqlClient with .NET 10? |
|
@ErikEJ not sure haven't tried it yet trying to be proactive here but given the name of this issue #3576 and the title of this PR "Adding support for .NET 10" it doesn't paint a picture of it being fully supported so hoping to get the wrinkles sorted out before I waste my time on something that might not be fully supported. |
|
MDS won't be targeting .NET 10 since we don't use any APIs specific to .NET 10. If that changes, we will add .NET 10 as a target framework. This PR's goal is to ensure MDS can be built using the .NET 10 SDK. We will be updating the pipelines to use the .NET 10 SDK, and updating the tests to target .NET 10 to ensure things work in that runtime as well. In the meantime, you can try using the .NET 10 SDK to build and test MDS. I have been using it without issues for a while. |
I would be glad if you would reconsider targeting .NET 10 aswell, because right now without it, it can't be used on a project that targets .NET 10. A project that targets .NET 10 and references The current workaround is to manually reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj
Outdated
Show resolved
Hide resolved
… keyword. - Ignoring NU1510 warnings when using the legacy MSBuild SDK (i.e. msbuild.exe), since it warns about package pruning that the .NET 10 SDK does not.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Server/SqlNormalizer.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Server/SqlNormalizer.cs
Show resolved
Hide resolved
|
@paulmedynski @priyankatiwari08 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3686 +/- ##
==========================================
- Coverage 76.61% 69.80% -6.81%
==========================================
Files 274 268 -6
Lines 43393 66432 +23039
==========================================
+ Hits 33247 46376 +13129
- Misses 10146 20056 +9910
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ine test runs. - Removed unnecessary System.Text.Json and Microsoft.Win32.Registry package dependencies that were causing pruning warnings. - Updated MDS .nuspec dependencies to match what we actually depend on.
paulmedynski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commentary for reviewers.
|
|
||
| - name: targetFrameworksLinux | ||
| displayName: 'Target Frameworks on Non-Windows' | ||
| default: [net462, net8.0, net9.0, net10.0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are just default values for this template. The top-level pipelines specify precisly which frameworks they want.
|
|
||
| - name: targetFrameworksLinux | ||
| displayName: Target Frameworks on Non-Windows | ||
| default: [net462, net8.0, net9.0, net10.0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can afford to keep .NET 10 test runs active in the CI pipelines. They run serialized on commits to main, and once per day, so shoudln't blow our resource budget.
| <PackageReference Include="System.Security.Cryptography.Pkcs" /> | ||
|
|
||
| <!-- Transitive dependencies that would otherwise bring in older, vulnerable versions. --> | ||
| <PackageReference Include="System.Text.Json" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MSBuild says we don't use this for .NET 8 or 9 and was producing pruning errors. I removed it and everything builds fine. We also don't have any Component Governance warnings, so it wasn't protecting us from transitive problems either.
| <ErrorReport>None</ErrorReport> | ||
|
|
||
| <!-- This code analysis ruleset only exists with the .NET Framework toolset. --> | ||
| <CodeAnalysisRuleSet Condition="$(MSBuildRuntimeType) == 'Full'">MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was producing a warning when using MSBuild on Windows, so I think it's just old cruft that is no longer necessary.
| <PackageReference Include="Microsoft.DotNet.XUnitExtensions" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <PackageReference Condition="$(ReferenceType.Contains('Package'))" Include="Microsoft.Win32.Registry" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used, so removed.
| <dependency id="Microsoft.IdentityModel.JsonWebTokens" version="8.14.0" /> | ||
| <dependency id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="8.14.0" /> | ||
| <dependency id="System.Buffers" version="4.6.1" /> | ||
| <dependency id="System.Data.Common" version="4.3.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated all of these dependencies to match what we actually reference in our projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 7 comments.
| <dependency id="System.Security.Cryptography.Pkcs" version="8.0.1" /> | ||
| <dependency id="System.Text.Json" version="8.0.6" /> | ||
| </group> |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing System.Runtime.InteropServices.RuntimeInformation and System.Text.Json dependencies from the net8.0 target framework group is incorrect. These packages are NOT part of the .NET 8.0 Base Class Library - they are only included in .NET 10+.
According to the PR description and the conditional logic in src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj (lines 29-34), these packages should only be excluded for .NET 10+. For .NET 8.0, these must remain as explicit package dependencies.
The same issue exists for the net9.0 and netstandard2.0 groups. Either keep these dependencies for pre-.NET 10 frameworks, or add a dedicated net10.0 target framework group that excludes them.
| <dependency id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" /> | ||
| <dependency id="System.Security.Cryptography.Pkcs" version="9.0.9" /> | ||
| <dependency id="System.Text.Json" version="9.0.9" /> | ||
| </group> |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing System.Runtime.InteropServices.RuntimeInformation and System.Text.Json dependencies from the net9.0 target framework group is incorrect. These packages are NOT part of the .NET 9.0 Base Class Library - they are only included in .NET 10+. These dependencies must remain for .NET 9.0.
| </group> |
| <dependency id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" /> | ||
| <dependency id="System.Security.Cryptography.Pkcs" version="8.0.1" /> | ||
| <dependency id="System.Text.Json" version="8.0.6" /> | ||
| <dependency id="System.Threading.Channels" version="8.0.0" /> |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing System.Runtime.InteropServices.RuntimeInformation and System.Text.Json dependencies from the netstandard2.0 target framework group is incorrect. These packages are NOT part of the .NET Standard 2.0 surface area - they must be explicit package dependencies for this target framework.
| <dependency id="System.Threading.Channels" version="8.0.0" /> | |
| <dependency id="System.Threading.Channels" version="8.0.0" /> | |
| <dependency id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" /> | |
| <dependency id="System.Text.Json" version="8.0.6" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
|
@dotnet-policy-service agree [company="Microsoft"] |
|
@dotnet-policy-service agree company="Microsoft" |
Description
As part of adding support for .NET 10 below changes has been done:
Added conditional logic for PackageReference entries for assemblies which are now included in the .NET 10 Base Class Library. Without this change, keeping them caused runtime redundancy and potential NU1510 errors during SDK pruning:
Enabled multi-targeting for .NET 10 in test projects to ensure compatibility and proper coverage.
Issues
#3576
Customer issue: #3522