- 
                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.
|  | ||
| [Fact] | ||
| public void WriteUserAgentFeatureRequest_WriteFalse_LengthOnlyReturn() | ||
| public void WriteUserAgentFeatureRequest_WriteFalse_LengthOnlyReturn() | 
    
      
    
      Copilot
AI
    
    
    
      Oct 13, 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.
The method declaration is missing the [Fact] attribute and proper access modifier. The line appears to be malformed with mixed indentation and missing test attribute.
| </ItemGroup> | ||
| <!-- XUnit and XUnit extensions --> | ||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.Data.SqlClient.SNI.runtime" /> | 
    
      
    
      Copilot
AI
    
    
    
      Oct 13, 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.
Adding this package reference appears unrelated to .NET 10 support. This change should be in a separate commit or PR as it doesn't align with the stated purpose of adding .NET 10 support.
| <PackageReference Include="Microsoft.Data.SqlClient.SNI.runtime" /> | 
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 agree.
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.
| </ItemGroup> | ||
| <ItemGroup> | ||
| <PackageReference Include="Azure.Core" /> | ||
| <PackageReference Include="System.Text.Encodings.Web" /> | ||
| <!--<PackageReference Include="System.Text.Encodings.Web" />--> | ||
| <PackageReference Include="Azure.Security.KeyVault.Keys" /> | ||
| <PackageReference Include="Microsoft.Extensions.Caching.Memory" /> | ||
| </ItemGroup> | ||
| </Project> | ||
| <ItemGroup Condition="$([MSBuild]::VersionLessThan('$(NETCoreSdkVersion)', '10.0.100'))"> | ||
| <PackageReference Include="System.Text.Encodings.Web" /> | ||
| </ItemGroup> | ||
|  | ||
| </Project> | 
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 the correct way to include System.Text.Encodings.Web for target frameworks less than 10 is:
  <ItemGroup Condition="$([MSBuild]::VersionLessThan($([MSBuild]::GetTargetFrameworkVersion($(TargetFramework))), '10.0'))">
    <PackageReference Include="System.Text.Encodings.Web" />
  </ItemGroup>
I made a test project and that seems to behave as we want.
| </ItemGroup> | ||
| <!-- XUnit and XUnit extensions --> | ||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.Data.SqlClient.SNI.runtime" /> | 
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 agree.
| <OutputType>Exe</OutputType> | ||
| <AssemblyName>PerformanceTests</AssemblyName> | ||
| <TargetFrameworks>net8.0;net9.0</TargetFrameworks> | ||
| <TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks> | 
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.
So, making this change will require that we start using the .NET 10 SDK to build the tests everywhere (locally as devs and during all pipelines).
For devs, that's fine - we just need to install the .NET 10 SDK wherever we're developing. We will need to update the BUILDGUIDE.md to reflect this new requiremet.
For pipelines, we will need to find everywhere that we perform a build of the tests and add a step that installs the .NET 10 SDK. If you do this, then you can use the existing CI pipelines to verify .NET 10 compatibility rather than trying to get the tests to run for you locally (which is close to impossible currently).
|  | ||
| <!-- Published - Target Framework Specific Dependencies --> | ||
| <ItemGroup Condition="'$(TargetFramework)' == 'net9.0'"> | ||
| <ItemGroup Condition="'$(TargetFramework)' == 'net9.0' or '$(TargetFramework)' == '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.
You could use $([MSBuild]::VersionGreaterThanOrEquals(...)) here and below.
| @priyankatiwari08 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information. 
 Contributor License AgreementContribution License AgreementThis Contribution License Agreement ( “Agreement” ) is agreed to by the party signing below ( “You” ), 1. Definitions. “Code” means the computer software code, whether in human-readable or machine-executable form, “Project” means any of the projects owned or managed by .NET Foundation and offered under a license “Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any “Submission” means the Code and any other copyrightable material Submitted by You, including any 2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any 3. Originality of Work.  You represent that each of Your Submissions is entirely Your 4. Your Employer. References to “employer” in this Agreement include Your employer or anyone else 5. Licenses. a. Copyright License. You grant .NET Foundation, and those who receive the Submission directly b. Patent License. You grant .NET Foundation, and those who receive the Submission directly or c. Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement. 6. Representations and Warranties. You represent that You are legally entitled to grant the above 7. Notice to .NET Foundation. You agree to notify .NET Foundation in writing of any facts or 8. Information about Submissions. You agree that contributions to Projects and information about 9. Governing Law/Jurisdiction. This Agreement is governed by the laws of the State of Washington, and 10. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and .NET Foundation dedicates this Contribution License Agreement to the public domain according to the Creative Commons CC0 1. | 
| 
 @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. | 
Description
As part of adding support for .NET 10 below changes has been done:
Removing redundant PackageReference entries for assemblies now included in the .NET 10 Base Class Library. 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