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 support for .NET 9 #2946

Merged
merged 83 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
1eeaea4
Update to .NET 9 preview 6
ErikEJ Jul 15, 2024
5b05bd4
Testing Net9 SDK support on pipelines
Jul 23, 2024
2913009
Revert NuGet.config change
ErikEJ Jul 26, 2024
e54daf3
Update pipeline
ErikEJ Jul 27, 2024
c010bd3
Suppressed error codes IL2093 and CA2022 when compiled using msbuild.
arellegue Sep 12, 2024
65710d6
Revert "Suppressed error codes IL2093 and CA2022 when compiled using …
arellegue Sep 12, 2024
119d70b
Derived from ErikEJ's issue-2669 branch and added fixes for msbuild C…
arellegue Sep 16, 2024
179fa81
Updated packages for .net9.0 to rc-1 versions.
arellegue Sep 18, 2024
4ee429f
Merge main
mdaigle Oct 31, 2024
b2a0c4b
Merge changes from Aris's branch
mdaigle Nov 1, 2024
8324368
merge main
mdaigle Nov 1, 2024
61da001
Add usedotnet task before build.
mdaigle Nov 4, 2024
c32d351
Fix formatting.
mdaigle Nov 4, 2024
54e4850
dotnet location debug logs.
mdaigle Nov 4, 2024
df7c8e8
List sdk and runtime versions and locations.
mdaigle Nov 4, 2024
ceb4f19
Switch image for nuget restore job.
mdaigle Nov 4, 2024
174ae48
Bump image for nuget restore.
mdaigle Nov 4, 2024
257868b
Temporarily remove test steps to reduce wait time. Remove dotnet 9 in…
mdaigle Nov 4, 2024
81756b3
Add global.json file to lock sdk version.
mdaigle Nov 4, 2024
fc60090
Fix target frameworks for netcore ref.
mdaigle Nov 4, 2024
5c7ab1c
Try base image with dotnet installed according to global.json
mdaigle Nov 5, 2024
0710337
Merge branch 'main' into net9-add-support
mdaigle Nov 5, 2024
7197ae7
Install dotnet 8 sdk.
mdaigle Nov 5, 2024
17667e2
Merge branch 'net9-add-support' of github.com:mdaigle/SqlClient into …
mdaigle Nov 5, 2024
76232f6
Allow multi level lookup and roll forward.
mdaigle Nov 5, 2024
3851ecc
Switch to runtime install. Clean up comments. Add test steps back int…
mdaigle Nov 5, 2024
417d199
Switch 8 install to sdk.
mdaigle Nov 5, 2024
bd5d2f4
Update target net version.
mdaigle Nov 5, 2024
29286a7
Use Stream extension to address CA2022.
mdaigle Nov 6, 2024
52b9cab
Merge branch 'main' into net9-add-support
mdaigle Nov 6, 2024
58a8b1d
Fix ReadExactly logic and preserve exceptions.
mdaigle Nov 6, 2024
6a74a48
Merge branch 'net9-add-support' of github.com:mdaigle/SqlClient into …
mdaigle Nov 6, 2024
0fb79bb
Fix certificate loading for net 8.
mdaigle Nov 6, 2024
fcefe05
Add debug assert on cert type.
mdaigle Nov 6, 2024
0444346
Remove other test configs
mdaigle Nov 6, 2024
82a8179
Use debug config.
mdaigle Nov 6, 2024
9e0db47
Set debug config.
mdaigle Nov 6, 2024
81c6bc3
Unset debug config.
mdaigle Nov 6, 2024
dd3bb15
Add pkcs package reference. Parse enclave health check cert as pkcs7.
mdaigle Nov 7, 2024
eb7fb98
Remove accidental using.
mdaigle Nov 7, 2024
e130803
Log health report cert type.
mdaigle Nov 7, 2024
e640ff2
Switch health report cert parsing to X509.
mdaigle Nov 7, 2024
d5ea073
Revert "Remove other test configs"
mdaigle Nov 7, 2024
61d64fa
PackageReference cleanup. Precompile symbol cleanup.
mdaigle Nov 7, 2024
91654f9
Remove extra property.
mdaigle Nov 7, 2024
3dc8485
Update stream test.
mdaigle Nov 7, 2024
0fd48c4
Remove test assertion.
mdaigle Nov 8, 2024
7308499
Install net9 via powershell.
mdaigle Nov 11, 2024
5f47358
Merge branch 'main' into net9-add-support
mdaigle Nov 11, 2024
c1cd969
Use task without global.json
mdaigle Nov 11, 2024
63e122a
Merge branch 'net9-add-support' of github.com:mdaigle/SqlClient into …
mdaigle Nov 11, 2024
acc9dcb
Remove .net8
mdaigle Nov 11, 2024
c21d029
Use multilevellookup
mdaigle Nov 11, 2024
e96b9e7
Try installing to program files
mdaigle Nov 12, 2024
03edd8c
fix input. use default for mac/linux.
mdaigle Nov 12, 2024
bf40390
Remove net9 install for windows. Remove pr triggers.
mdaigle Nov 18, 2024
69fcaa7
Merge branch 'main' into net9-add-support
mdaigle Nov 18, 2024
8d500a3
Try artifact again.
mdaigle Nov 21, 2024
121b486
Install net 9 via task. Update packages.
mdaigle Nov 21, 2024
63cb959
Merge branch 'net9-add-support' of github.com:mdaigle/SqlClient into …
mdaigle Nov 21, 2024
84ccf87
Add license statements.
mdaigle Nov 21, 2024
7128075
Use regular mms.
mdaigle Nov 21, 2024
a929807
Move stream extensions. Use new certificate functionality for all tar…
mdaigle Nov 21, 2024
f728c54
Fix dynamic accessed member types warning
mdaigle Nov 21, 2024
8762a8c
Fix service point manager warning. Add back stream extensions for tests.
mdaigle Nov 21, 2024
5a3b272
Use certificate loader.
mdaigle Nov 21, 2024
898288b
Adjust tests.
mdaigle Nov 21, 2024
8d735e7
Fix tests.
mdaigle Nov 21, 2024
e2c4e30
Fix tests.
mdaigle Nov 21, 2024
fe363e2
How did these get dropped?
mdaigle Nov 22, 2024
393b66e
Address review comments.
mdaigle Nov 22, 2024
43a709f
Add System.ServiceProcess.ServiceController to manual tests in netfx.
mdaigle Nov 22, 2024
b2e5579
Update for package build
cheenamalhotra Nov 22, 2024
baea11f
Reference System.Transactions
mdaigle Nov 22, 2024
a701b8a
Merge branch 'net9-add-support' of github.com:mdaigle/SqlClient into …
mdaigle Nov 22, 2024
8936f45
Fix System.Transaction reference.
mdaigle Nov 22, 2024
789a76a
Add pkcs to manual tests project to support package pipeline, lacking…
mdaigle Nov 22, 2024
32df37c
Add pkcs to functional tests project to support package pipeline, lac…
mdaigle Nov 22, 2024
0a0f389
Add Microsoft.Bcl.Cryptography
mdaigle Nov 22, 2024
d68d275
Merge branch 'main' into net9-add-support
mdaigle Nov 22, 2024
45d4497
Address review comments.
mdaigle Nov 25, 2024
d10cbad
Merge branch 'net9-add-support' of github.com:mdaigle/SqlClient into …
mdaigle Nov 25, 2024
6ac682e
Bump ExtUtilities to net9.
mdaigle Nov 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions eng/pipelines/common/templates/steps/ci-prebuild-step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ parameters:
- Package

steps:

- task: UseDotNet@2
displayName: 'Download .NET SDK'
inputs:
packageType: 'sdk'
version: '9.x'
includePreviewVersions: true

- ${{if eq(parameters.debug, true)}}:
- powershell: |
Get-ChildItem env: | Sort-Object Name
Expand Down
6 changes: 3 additions & 3 deletions eng/pipelines/dotnet-sqlclient-ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
- name: targetFrameworks
displayName: 'Target Frameworks on Windows'
type: object
default: [net462, net8.0]
default: [net462, net8.0, net9.0]

- name: targetFrameworksLinux
displayName: 'Target Frameworks on Non-Windows'
type: object
default: [net8.0]
default: [net8.0, net9.0]

- name: netcoreVersionTestUtils
displayName: 'Netcore Version for Test Utilities'
Expand Down Expand Up @@ -157,7 +157,7 @@ stages:
windows_sql_22:
pool: ${{parameters.defaultPoolName }}
images:
Win22_Sql22: ADO-MMS22-SQL22
Win22_Sql22: ADO-MMS22-SQL22-Net9.0
TargetFrameworks: ${{parameters.targetFrameworks }}
netcoreVersionTestUtils: ${{parameters.netcoreVersionTestUtils }}
buildPlatforms: ${{parameters.buildPlatforms }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
- name: targetFrameworks
displayName: 'Target Frameworks on Windows'
type: object
default: [net462, net8.0]
default: [net462, net8.0, net9.0]

- name: targetFrameworksLinux
displayName: 'Target Frameworks on Non-Windows'
type: object
default: [net8.0]
default: [net8.0, net9.0]

- name: buildPlatforms
displayName: 'Build Platforms on Windows'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
- name: targetFrameworks
displayName: 'Target Frameworks on Windows'
type: object
default: [net462, net8.0]
default: [net462, net8.0, net9.0]

- name: targetFrameworksLinux
displayName: 'Target Frameworks on Non-Windows'
type: object
default: [net8.0]
default: [net8.0, net9.0]

- name: buildPlatforms
displayName: 'Build Platforms on Windows'
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/libraries/mds-validation-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ variables:
- name: expectedFolderNames
value: lib,ref,runtimes
- name: expectedDotnetVersions
value: net462,net8.0
value: net462,net8.0,net9.0
- name: Database
value: Northwind
- name: platform
value: AnyCPU
- name: TargetNetFxVersion
value: net481
- name: TargetNetCoreVersion
value: net8.0
value: net9.0
- name: SQLTarget
value: localhost
- name: encrypt
Expand Down
1 change: 1 addition & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<!-- Provides Version properties -->
<Import Project="$(ToolsDir)props\Versions.props" />
<Import Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))" Project="$(ToolsDir)props\VersionsNet8OrLater.props" />
<Import Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))" Project="$(ToolsDir)props\VersionsNet9OrLater.props" />
<!-- Provides Tool properties -->
<Import Project="$(ToolsDir)props\Tools.props" />
<!-- Provides Build properties -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0, net9.0</TargetFrameworks>
<IntermediateOutputPath>$(ObjFolder)$(Configuration)\$(AssemblyName)\ref\</IntermediateOutputPath>
<OutputPath>$(BinFolder)$(Configuration)\$(AssemblyName)\ref\</OutputPath>
<DocumentationFile>$(OutputPath)\$(TargetFramework)\Microsoft.Data.SqlClient.xml</DocumentationFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>Microsoft.Data.SqlClient</AssemblyName>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(OSGroup)' == 'AnyOS'">Microsoft.Data.SqlClient is not supported on this platform.</GeneratePlatformNotSupportedAssemblyMessage>
<OSGroup Condition="'$(OSGroup)' == ''">$(OS)</OSGroup>
<TargetsWindows Condition="'$(OSGroup)'=='Windows_NT'">true</TargetsWindows>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ private object DeNormalizeInternal(
if (nullByte == 0)
{
result = _nullInstance;
s.Read(_padBuffer, 0, _padBuffer.Length);
#if NET8_0_OR_GREATER
s.ReadExactly(_padBuffer, 0, _padBuffer.Length);
#else
s.Read(_padBuffer, 0, _padBuffer.Length);
#endif
return result;
}
}
Expand Down Expand Up @@ -288,7 +292,7 @@ protected void FlipAllBits(byte[] b)
protected object GetValue(FieldInfo fi, object obj) => fi.GetValue(obj);
#if NETFRAMEWORK
[System.Security.Permissions.ReflectionPermission(System.Security.Permissions.SecurityAction.Assert, MemberAccess = true)]
#endif
#endif
protected void SetValue(FieldInfo fi, object recvr, object value) => fi.SetValue(recvr, value);

internal abstract int Size { get; }
Expand Down Expand Up @@ -379,7 +383,11 @@ internal override void Normalize(FieldInfo fi, object obj, Stream s)
internal override void DeNormalize(FieldInfo fi, object recvr, Stream s)
{
byte[] b = new byte[2];
#if NET8_0_OR_GREATER
s.ReadExactly(b, 0, b.Length);
#else
s.Read(b, 0, b.Length);
#endif
if (!_skipNormalize)
{
b[0] ^= 0x80;
Expand All @@ -406,7 +414,11 @@ internal override void Normalize(FieldInfo fi, object obj, Stream s)
internal override void DeNormalize(FieldInfo fi, object recvr, Stream s)
{
byte[] b = new byte[2];
#if NET8_0_OR_GREATER
s.ReadExactly(b, 0, b.Length);
#else
s.Read(b, 0, b.Length);
#endif
if (!_skipNormalize)
{
Array.Reverse(b);
Expand All @@ -433,7 +445,11 @@ internal override void Normalize(FieldInfo fi, object obj, Stream s)
internal override void DeNormalize(FieldInfo fi, object recvr, Stream s)
{
byte[] b = new byte[4];
#if NET8_0_OR_GREATER
s.ReadExactly(b, 0, b.Length);
mdaigle marked this conversation as resolved.
Show resolved Hide resolved
#else
s.Read(b, 0, b.Length);
#endif
if (!_skipNormalize)
{
b[0] ^= 0x80;
Expand All @@ -460,7 +476,11 @@ internal override void Normalize(FieldInfo fi, object obj, Stream s)
internal override void DeNormalize(FieldInfo fi, object recvr, Stream s)
{
byte[] b = new byte[4];
#if NET8_0_OR_GREATER
s.ReadExactly(b, 0, b.Length);
#else
s.Read(b, 0, b.Length);
#endif
if (!_skipNormalize)
{
Array.Reverse(b);
Expand All @@ -487,7 +507,11 @@ internal override void Normalize(FieldInfo fi, object obj, Stream s)
internal override void DeNormalize(FieldInfo fi, object recvr, Stream s)
{
byte[] b = new byte[8];
#if NET8_0_OR_GREATER
s.ReadExactly(b, 0, b.Length);
#else
s.Read(b, 0, b.Length);
#endif
if (!_skipNormalize)
{
b[0] ^= 0x80;
Expand All @@ -514,7 +538,11 @@ internal override void Normalize(FieldInfo fi, object obj, Stream s)
internal override void DeNormalize(FieldInfo fi, object recvr, Stream s)
{
byte[] b = new byte[8];
#if NET8_0_OR_GREATER
s.ReadExactly(b, 0, b.Length);
#else
s.Read(b, 0, b.Length);
#endif
if (!_skipNormalize)
{
Array.Reverse(b);
Expand Down Expand Up @@ -559,7 +587,11 @@ internal override void Normalize(FieldInfo fi, object obj, Stream s)
internal override void DeNormalize(FieldInfo fi, object recvr, Stream s)
{
byte[] b = new byte[4];
#if NET8_0_OR_GREATER
s.ReadExactly(b, 0, b.Length);
#else
s.Read(b, 0, b.Length);
#endif
if (!_skipNormalize)
{
if ((b[0] & 0x80) > 0)
Expand Down Expand Up @@ -614,7 +646,11 @@ internal override void Normalize(FieldInfo fi, object obj, Stream s)
internal override void DeNormalize(FieldInfo fi, object recvr, Stream s)
{
byte[] b = new byte[8];
#if NET8_0_OR_GREATER
s.ReadExactly(b, 0, b.Length);
#else
s.Read(b, 0, b.Length);
#endif
if (!_skipNormalize)
{
if ((b[0] & 0x80) > 0)
Expand Down
1 change: 1 addition & 0 deletions src/Microsoft.Data.SqlClient/tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Configurations>Debug;Release;</Configurations>
<Platforms>AnyCPU;x86;x64</Platforms>
<ReferenceType Condition="'$(ReferenceType)'==''">Project</ReferenceType>
<NuGetAudit>false</NuGetAudit>
mdaigle marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>

<!--These properties can be modified locally to target .NET version of choice to build and test entire test suite-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<AssemblyName>PerformanceTests</AssemblyName>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<Configurations>Debug;Release;</Configurations>
<IntermediateOutputPath>$(ObjFolder)$(Configuration).$(Platform).$(AssemblyName)</IntermediateOutputPath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
mdaigle marked this conversation as resolved.
Show resolved Hide resolved
<StartupObject>Microsoft.Data.SqlClient.ExtUtilities.Runner</StartupObject>
</PropertyGroup>
<ItemGroup>
Expand Down
9 changes: 9 additions & 0 deletions tools/props/VersionsNet9OrLater.props
mdaigle marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Net9 project dependencies -->
<PropertyGroup>
<SystemConfigurationConfigurationManagerVersion>9.0.0-preview.6.24327.7</SystemConfigurationConfigurationManagerVersion>
<SystemRuntimeCachingVersion>9.0.0-preview.6.24327.7</SystemRuntimeCachingVersion>
<MicrosoftExtensionsCachingMemoryVersion>9.0.0-preview.6.24327.7</MicrosoftExtensionsCachingMemoryVersion>
</PropertyGroup>
</Project>
Loading