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

Update to .NET 9 #2674

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<configuration>
<packageSources>
<clear />
<add key="sqlclient" value="https://sqlclientdrivers.pkgs.visualstudio.com/public/_packaging/sqlclient/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
ErikEJ marked this conversation as resolved.
Show resolved Hide resolved
</packageSources>
</configuration>
4 changes: 2 additions & 2 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, net6.0, net8.0]
default: [net462, net6.0, net8.0, net9.0]

- name: targetFrameworksLinux
displayName: 'Target Frameworks on Non-Windows'
type: object
default: [net6.0, net8.0]
default: [net6.0, 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 @@ -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, net6.0, net8.0]
default: [net462, net6.0, net8.0, net9.0]

- name: targetFrameworksLinux
displayName: 'Target Frameworks on Non-Windows'
type: object
default: [net6.0, net8.0]
default: [net6.0, 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, net6.0, net8.0]
default: [net462, net6.0, net8.0, net9.0]

- name: targetFrameworksLinux
displayName: 'Target Frameworks on Non-Windows'
type: object
default: [net6.0, net8.0]
default: [net6.0, 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 @@ -15,15 +15,15 @@ variables:
- name: expectedFolderNames
value: lib,ref,runtimes
- name: expectedDotnetVersions
value: net462,net6.0,net8.0
value: net462,net6.0,net8.0,net9.0
- name: Database
value: Northwind
- name: platform
value: AnyCPU
- name: TargetNetFxVersion
value: net481
- name: TargetNetCoreVersion
value: net8.0
value: net9.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what the exact purpose of this value is

- 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 @@ -85,6 +85,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>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;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;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net6.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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes the new CA2022

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);
#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>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To prevent NuGet audit on test projects giving warnings as errors on old packages

</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>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;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>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
<StartupObject>Microsoft.Data.SqlClient.ExtUtilities.Runner</StartupObject>
</PropertyGroup>
<ItemGroup>
Expand Down
9 changes: 9 additions & 0 deletions tools/props/VersionsNet9OrLater.props
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