Skip to content

Commit 22ac587

Browse files
authored
Add support for .NET 9 (#2946)
Enhancements: Adds .NET 9 to target frameworks Fixes: Adds missing DynamicallyAccessedMembers attribute to GetProviderSpecificFieldType and GetFieldType in netcore ref project. Removes suppressions due to missing annotations in net6.0 Switches X509Certificate construction to use X509CertificateLoader. Switches PKCS decoding to use SignedCMS. Adds internal ReadExactly extension to System.IO.Stream in netfx to provide API parity between netcore and netfx and to address CA2022. Guards ServicePointManager usage to netfx only, deprecated in .NET 9 https://learn.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/syslib0014 https://learn.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager?view=net-9.0 Package Versions: Adds System.Security.Cryptography.Pkcs:9.0.0 to address SYSLIB0057 Adds Microsoft.Bcl.Cryptography:9.0.0, dependency of the pkcs package Bumps Microsoft.Extensions.Caching.Memory to 9.0.0 Bumps System.Configuration.ConfigurationManager to 9.0.0 Test Dependencies: Bumps Microsoft.DotNet.RemoteExecutor to 10.0.0-beta.24564.1 Bumps Xunit to 2.6.3 for all frameworks
1 parent 1348c3c commit 22ac587

File tree

37 files changed

+189
-80
lines changed

37 files changed

+189
-80
lines changed

build.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<IsEnabledWindows Condition="'$(TargetsUnix)' == 'true'">false</IsEnabledWindows>
2020
<TestOS Condition="'$(TestTargetOS)' == '' AND '$(TargetsWindows)' == 'true'">Windows</TestOS>
2121
<TestOS Condition="'$(TestTargetOS)' == '' AND '$(TargetsUnix)' == 'true'">Unix</TestOS>
22-
<TF Condition="$(TF) == ''">net8.0</TF> <!-- Default Target Framework -->
22+
<TF Condition="$(TF) == ''">net9.0</TF> <!-- Default Target Framework -->
2323
<TFGroup Condition="'$([MSBuild]::GetTargetFrameworkIdentifier($(TF)))' == '.NETFramework'">netfx</TFGroup>
2424
<TFGroup Condition="'$([MSBuild]::GetTargetFrameworkIdentifier($(TF)))' == '.NETCoreApp'">netcore</TFGroup>
2525
<TargetGroup Condition="'$(TFGroup)' == 'netfx'" >netfx</TargetGroup>

eng/pipelines/common/templates/steps/ci-prebuild-step.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ parameters:
2020
- Package
2121

2222
steps:
23+
- task: UseDotNet@2
24+
displayName: 'Use .NET 9.x sdk'
25+
inputs:
26+
packageType: sdk
27+
version: '9.x'
28+
29+
- task: UseDotNet@2
30+
displayName: 'Install .NET 8.x runtime'
31+
inputs:
32+
packageType: runtime
33+
version: '8.x'
34+
2335
- ${{if eq(parameters.debug, true)}}:
2436
- powershell: |
2537
Get-ChildItem env: | Sort-Object Name

eng/pipelines/common/templates/steps/ci-project-build-step.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ parameters:
3434
- all
3535

3636
steps:
37+
- task: UseDotNet@2
38+
displayName: 'Use .NET 9.x sdk'
39+
inputs:
40+
packageType: sdk
41+
version: '9.x'
42+
43+
- task: UseDotNet@2
44+
displayName: 'Install .NET 8.x runtime'
45+
inputs:
46+
packageType: runtime
47+
version: '8.x'
48+
3749
- ${{ if or(eq(parameters.operatingSystem, 'Windows'), eq(parameters.operatingSystem, 'deferedToRuntime')) }}:
3850
- ${{ if or(eq(parameters.build, 'MDS'), eq(parameters.build, 'all')) }}:
3951
- task: MSBuild@1

eng/pipelines/common/templates/steps/copy-dlls-for-test-step.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ parameters:
2727
default:
2828
- net462
2929
- net8.0
30+
- net9.0
3031

3132
- name: product
3233
default: MDS

eng/pipelines/common/templates/steps/prepare-test-db-step.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ parameters:
1010

1111
- name: targetFramework
1212
type: string
13-
default: net8.0
13+
default: net9.0
1414

1515
steps:
1616
- task: DotNetCoreCLI@2

eng/pipelines/dotnet-sqlclient-ci-core.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# The .NET Foundation licenses this file to you under the MIT license. #
44
# See the LICENSE file in the project root for more information. #
55
#################################################################################
6-
parameters: # parameters are shown up in ADO UI in a build queue time
6+
parameters:
77
- name: 'debug'
88
displayName: 'Enable debug output'
99
type: boolean
@@ -12,17 +12,17 @@ parameters: # parameters are shown up in ADO UI in a build queue time
1212
- name: targetFrameworks
1313
displayName: 'Target Frameworks on Windows'
1414
type: object
15-
default: [net462, net8.0]
15+
default: [net462, net8.0, net9.0]
1616

1717
- name: targetFrameworksLinux
1818
displayName: 'Target Frameworks on Non-Windows'
1919
type: object
20-
default: [net8.0]
20+
default: [net8.0, net9.0]
2121

2222
- name: netcoreVersionTestUtils
2323
displayName: 'Netcore Version for Test Utilities'
2424
type: object
25-
default: net8.0
25+
default: net9.0
2626

2727
- name: buildPlatforms
2828
displayName: 'Build Platforms on Windows'

eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
4545
- name: targetFrameworks
4646
displayName: 'Target Frameworks on Windows'
4747
type: object
48-
default: [net462, net8.0]
48+
default: [net462, net8.0, net9.0]
4949

5050
- name: targetFrameworksLinux
5151
displayName: 'Target Frameworks on Non-Windows'
5252
type: object
53-
default: [net8.0]
53+
default: [net8.0, net9.0]
5454

5555
- name: buildPlatforms
5656
displayName: 'Build Platforms on Windows'

eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
3737
- name: targetFrameworks
3838
displayName: 'Target Frameworks on Windows'
3939
type: object
40-
default: [net462, net8.0]
40+
default: [net462, net8.0, net9.0]
4141

4242
- name: targetFrameworksLinux
4343
displayName: 'Target Frameworks on Non-Windows'
4444
type: object
45-
default: [net8.0]
45+
default: [net8.0, net9.0]
4646

4747
- name: buildPlatforms
4848
displayName: 'Build Platforms on Windows'

eng/pipelines/libraries/mds-validation-variables.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ variables:
1717
- name: expectedFolderNames
1818
value: lib,ref,runtimes
1919
- name: expectedDotnetVersions
20-
value: net462,net8.0
20+
value: net462,net8.0,net9.0
2121
- name: Database
2222
value: Northwind
2323
- name: platform
2424
value: AnyCPU
2525
- name: TargetNetFxVersion
2626
value: net481
2727
- name: TargetNetCoreVersion
28-
value: net8.0
28+
value: net9.0
2929
- name: SQLTarget
3030
value: localhost
3131
- name: encrypt

src/Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585

8686
<!-- Provides Version properties -->
8787
<Import Project="$(ToolsDir)props\Versions.props" />
88-
<Import Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))" Project="$(ToolsDir)props\VersionsNet8OrLater.props" />
8988
<!-- Provides Tool properties -->
9089
<Import Project="$(ToolsDir)props\Tools.props" />
9190
<!-- Provides Build properties -->

0 commit comments

Comments
 (0)