From 8afc1292b063f48a7c5b8510b74eed90320fba7a Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Sun, 28 Jan 2024 13:26:33 +0100 Subject: [PATCH 01/25] Build with less targets --- src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props | 6 ++---- .../netcore/ref/Microsoft.Data.SqlClient.csproj | 2 +- .../netcore/src/Microsoft.Data.SqlClient.csproj | 2 +- .../FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj | 5 ++--- .../Microsoft.Data.SqlClient.ManualTesting.Tests.csproj | 1 + 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props b/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props index 3ec7e5a49c..20e04ee098 100644 --- a/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props +++ b/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props @@ -17,7 +17,6 @@ net462 - netstandard2.0 net6.0 @@ -28,14 +27,13 @@ - $(TargetNetFxVersion);$(TargetNetCoreVersion);$(TargetNetStandardVersion) - $(TargetNetCoreVersion);$(TargetNetStandardVersion) + $(TargetNetFxVersion);$(TargetNetCoreVersion) + $(TargetNetCoreVersion) - netstandard2.0;netstandard2.1 net6.0;net8.0 net462 diff --git a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj index 9ab6b8d80f..753662290f 100644 --- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj +++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj @@ -1,7 +1,7 @@  false - net8.0;net6.0;netstandard2.0;netstandard2.1 + net8.0;net6.0 netstandard2.1 $(ObjFolder)$(Configuration)\$(AssemblyName)\ref\ $(BinFolder)$(Configuration)\$(AssemblyName)\ref\ diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj index 122fcaa089..afc2fc0d45 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj @@ -1,7 +1,7 @@  Microsoft.Data.SqlClient - net8.0;net6.0;netstandard2.0;netstandard2.1 + net8.0;net6.0 netstandard2.1 Microsoft.Data.SqlClient is not supported on this platform. $(OS) diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj index aedae160a7..7c90b7a975 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj @@ -1,5 +1,6 @@  + net6.0;net8.0;net462 false FunctionalTests netfx @@ -106,9 +107,7 @@ - - Address - + TDS.Servers diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj index 1ed87d83cb..9cc1601409 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj @@ -1,5 +1,6 @@  + net6.0;net8.0;net462 {45DB5F86-7AE3-45C6-870D-F9357B66BDB5} ManualTests netfx From 7bc9dfa98fe5155f5d40a1d22b1ea87f9ca56a2e Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 29 Jan 2024 07:39:51 +0100 Subject: [PATCH 02/25] remove netstandard from tests --- src/Microsoft.Data.SqlClient.sln | 19 ------------------- .../add-ons/Directory.Build.props | 2 +- .../CustomRetryLogicProvider.csproj | 1 - .../tests/Directory.Build.props | 2 +- .../Microsoft.Data.SqlClient.Tests.csproj | 5 +---- .../tests/FunctionalTests/SqlCommandTest.cs | 12 ++++++------ ....Data.SqlClient.ManualTesting.Tests.csproj | 7 +++---- .../SQL/UdtTest/UDTs/Address/Address.csproj | 1 - .../SQL/UdtTest/UDTs/Circle/Circle.csproj | 1 - .../SQL/UdtTest/UDTs/Shapes/Shapes.csproj | 1 - .../UdtTest/UDTs/Utf8String/Utf8String.csproj | 1 - .../Microsoft.Data.SqlClient.NSLibrary.csproj | 13 ------------- 12 files changed, 12 insertions(+), 53 deletions(-) delete mode 100644 src/Microsoft.Data.SqlClient/tests/NSLibrary/Microsoft.Data.SqlClient.NSLibrary.csproj diff --git a/src/Microsoft.Data.SqlClient.sln b/src/Microsoft.Data.SqlClient.sln index d47f0a450e..04668c8f81 100644 --- a/src/Microsoft.Data.SqlClient.sln +++ b/src/Microsoft.Data.SqlClient.sln @@ -179,12 +179,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Data.SqlTypes", " EndProject Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.SqlClient.NSLibrary", "Microsoft.Data.SqlClient\tests\NSLibrary\Microsoft.Data.SqlClient.NSLibrary.csproj", "{E7336BFB-8521-423A-A140-3123F9065C5D}" - ProjectSection(ProjectDependencies) = postProject - {37431336-5307-4184-9356-C4B7E47DC714} = {37431336-5307-4184-9356-C4B7E47DC714} - {407890AC-9876-4FEF-A6F1-F36A876BAADE} = {407890AC-9876-4FEF-A6F1-F36A876BAADE} - EndProjectSection -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.SqlClient.TestUtilities", "Microsoft.Data.SqlClient\tests\tools\Microsoft.Data.SqlClient.TestUtilities\Microsoft.Data.SqlClient.TestUtilities.csproj", "{89D6D382-9B36-43C9-A912-03802FDA8E36}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.SqlClient.ExtUtilities", "Microsoft.Data.SqlClient\tests\tools\Microsoft.Data.SqlClient.ExtUtilities\Microsoft.Data.SqlClient.ExtUtilities.csproj", "{E4C08DCE-DC29-4FEB-B655-1E7287DB5A2B}" @@ -410,18 +404,6 @@ Global {F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Release|x64.Build.0 = Release|Any CPU {F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Release|x86.ActiveCfg = Release|Any CPU {F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Release|x86.Build.0 = Release|Any CPU - {E7336BFB-8521-423A-A140-3123F9065C5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E7336BFB-8521-423A-A140-3123F9065C5D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E7336BFB-8521-423A-A140-3123F9065C5D}.Debug|x64.ActiveCfg = Debug|x64 - {E7336BFB-8521-423A-A140-3123F9065C5D}.Debug|x64.Build.0 = Debug|x64 - {E7336BFB-8521-423A-A140-3123F9065C5D}.Debug|x86.ActiveCfg = Debug|x86 - {E7336BFB-8521-423A-A140-3123F9065C5D}.Debug|x86.Build.0 = Debug|x86 - {E7336BFB-8521-423A-A140-3123F9065C5D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E7336BFB-8521-423A-A140-3123F9065C5D}.Release|Any CPU.Build.0 = Release|Any CPU - {E7336BFB-8521-423A-A140-3123F9065C5D}.Release|x64.ActiveCfg = Release|x64 - {E7336BFB-8521-423A-A140-3123F9065C5D}.Release|x64.Build.0 = Release|x64 - {E7336BFB-8521-423A-A140-3123F9065C5D}.Release|x86.ActiveCfg = Release|x86 - {E7336BFB-8521-423A-A140-3123F9065C5D}.Release|x86.Build.0 = Release|x86 {89D6D382-9B36-43C9-A912-03802FDA8E36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {89D6D382-9B36-43C9-A912-03802FDA8E36}.Debug|Any CPU.Build.0 = Debug|Any CPU {89D6D382-9B36-43C9-A912-03802FDA8E36}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -518,7 +500,6 @@ Global {5D1F0032-7B0D-4FB6-A969-FCFB25C9EA1D} = {71F356DC-DFA3-4163-8BFE-D268722CE189} {650EB7FA-EB0D-4F8E-AB2C-161C3AD8E363} = {71F356DC-DFA3-4163-8BFE-D268722CE189} {5A7600BD-AED8-44AB-8F2A-7CB33A8D9C02} = {71F356DC-DFA3-4163-8BFE-D268722CE189} - {E7336BFB-8521-423A-A140-3123F9065C5D} = {0CC4817A-12F3-4357-912C-09315FAAD008} {89D6D382-9B36-43C9-A912-03802FDA8E36} = {0CC4817A-12F3-4357-912C-09315FAAD008} {E4C08DCE-DC29-4FEB-B655-1E7287DB5A2B} = {0CC4817A-12F3-4357-912C-09315FAAD008} {B499E477-C9B1-4087-A5CF-5C762D90E433} = {0CC4817A-12F3-4357-912C-09315FAAD008} diff --git a/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props b/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props index 20e04ee098..4ec39ed694 100644 --- a/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props +++ b/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props @@ -27,7 +27,7 @@ - $(TargetNetFxVersion);$(TargetNetCoreVersion) + $(TargetNetCoreVersion);$(TargetNetFxVersion) $(TargetNetCoreVersion) diff --git a/src/Microsoft.Data.SqlClient/tests/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj b/src/Microsoft.Data.SqlClient/tests/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj index 4c4d66ca94..8a076d1e52 100644 --- a/src/Microsoft.Data.SqlClient/tests/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj +++ b/src/Microsoft.Data.SqlClient/tests/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj @@ -13,7 +13,6 @@ - diff --git a/src/Microsoft.Data.SqlClient/tests/Directory.Build.props b/src/Microsoft.Data.SqlClient/tests/Directory.Build.props index 7e412a3375..12c7957a23 100644 --- a/src/Microsoft.Data.SqlClient/tests/Directory.Build.props +++ b/src/Microsoft.Data.SqlClient/tests/Directory.Build.props @@ -24,7 +24,7 @@ - $(TargetNetFxVersion);$(TargetNetCoreVersion); + $(TargetNetCoreVersion);$(TargetNetFxVersion) $(TargetNetCoreVersion); diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj index 7c90b7a975..b89cb6e7b8 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj @@ -9,7 +9,6 @@ win-$(Platform) $(DefineConstants);NETFRAMEWORK $(DefineConstants);NETCOREAPP - NETSTANDARDREFERNCE $(ObjFolder)$(Configuration).$(Platform).$(AssemblyName) $(BinFolder)$(Configuration).$(Platform).$(AssemblyName) true @@ -94,7 +93,6 @@ - @@ -117,10 +115,9 @@ TDS - + - diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlCommandTest.cs b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlCommandTest.cs index 0a1a8e9ef5..c5e3b000dc 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlCommandTest.cs +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlCommandTest.cs @@ -125,7 +125,7 @@ public void Constructor3() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NETFRAMEWORK && !NETSTANDARDREFERNCE +#if NETFRAMEWORK // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -166,7 +166,7 @@ public void Constructor4() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NETFRAMEWORK && !NETSTANDARDREFERNCE +#if NETFRAMEWORK // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -184,7 +184,7 @@ public void Constructor4() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NETFRAMEWORK && !NETSTANDARDREFERNCE +#if NETFRAMEWORK // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -202,7 +202,7 @@ public void Constructor4() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NETFRAMEWORK && !NETSTANDARDREFERNCE +#if NETFRAMEWORK // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -224,7 +224,7 @@ public void Clone() cmd.CommandType = CommandType.StoredProcedure; cmd.DesignTimeVisible = false; cmd.Notification = notificationReq; -#if NETFRAMEWORK && !NETSTANDARDREFERNCE +#if NETFRAMEWORK // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -240,7 +240,7 @@ public void Clone() Assert.Null(cmd.Connection); Assert.False(cmd.DesignTimeVisible); Assert.Same(notificationReq, cmd.Notification); -#if NETFRAMEWORK && !NETSTANDARDREFERNCE +#if NETFRAMEWORK // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj index 9cc1601409..e3fae3cf5c 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj @@ -15,7 +15,7 @@ $(BinFolder)$(Configuration).$(Platform).$(AssemblyName) true - + @@ -31,7 +31,7 @@ TCECryptoNativeBaselineRsa.txt - + @@ -257,7 +257,7 @@ - + @@ -310,7 +310,6 @@ - diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj index e525bdeda3..941b08588c 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj @@ -11,7 +11,6 @@ - diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Circle/Circle.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Circle/Circle.csproj index 750ae10973..93137d1883 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Circle/Circle.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Circle/Circle.csproj @@ -11,7 +11,6 @@ - diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Shapes/Shapes.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Shapes/Shapes.csproj index d2b894a83d..596f7ffe74 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Shapes/Shapes.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Shapes/Shapes.csproj @@ -11,7 +11,6 @@ - diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Utf8String/Utf8String.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Utf8String/Utf8String.csproj index 4b520c0286..ec1229e0e7 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Utf8String/Utf8String.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Utf8String/Utf8String.csproj @@ -11,7 +11,6 @@ - diff --git a/src/Microsoft.Data.SqlClient/tests/NSLibrary/Microsoft.Data.SqlClient.NSLibrary.csproj b/src/Microsoft.Data.SqlClient/tests/NSLibrary/Microsoft.Data.SqlClient.NSLibrary.csproj deleted file mode 100644 index c7658cb0a5..0000000000 --- a/src/Microsoft.Data.SqlClient/tests/NSLibrary/Microsoft.Data.SqlClient.NSLibrary.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - netstandard2.0;netstandard2.1 - netstandard2.1 - $(ObjFolder)$(Configuration).$(Platform)\$(AssemblyName) - $(BinFolder)$(Configuration).$(Platform)\$(AssemblyName) - - - - - - From e5476f1572bff3729ef5287ef2e42278d960b8e9 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 29 Jan 2024 10:58:28 +0100 Subject: [PATCH 03/25] Update product .csprojs --- .../Microsoft.Data.SqlClient.NetStandard.cs | 16 -- .../ref/Microsoft.Data.SqlClient.csproj | 13 +- .../Data/SqlClient/SNI/SNIStreams.Task.cs | 97 -------- .../SNI/SslOverTdsStream.NetStandard.cs | 227 ------------------ ...thenticationProviderManager.NetStandard.cs | 19 -- .../SqlDelegatedTransaction.NetStandard.cs | 26 -- .../Data/SqlClient/TdsParser.NetStandard.cs | 45 ---- .../SqlClient/EnclaveDelegate.NotSupported.cs | 59 ----- ...claveAttestationParameters.NotSupported.cs | 23 -- 9 files changed, 2 insertions(+), 523 deletions(-) delete mode 100644 src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.NetStandard.cs delete mode 100644 src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIStreams.Task.cs delete mode 100644 src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SslOverTdsStream.NetStandard.cs delete mode 100644 src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.NetStandard.cs delete mode 100644 src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.NetStandard.cs delete mode 100644 src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.NetStandard.cs delete mode 100644 src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveDelegate.NotSupported.cs delete mode 100644 src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlEnclaveAttestationParameters.NotSupported.cs diff --git a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.NetStandard.cs b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.NetStandard.cs deleted file mode 100644 index bdb2042b84..0000000000 --- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.NetStandard.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -// ------------------------------------------------------------------------------ -// Changes to this file must follow the http://aka.ms/api-review process. -// ------------------------------------------------------------------------------ - -namespace Microsoft.Data.SqlClient -{ - /// - public sealed partial class ActiveDirectoryAuthenticationProvider : SqlAuthenticationProvider - { - /// - public void SetParentActivityOrWindowFunc(System.Func parentActivityOrWindowFunc) { } - } -} diff --git a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj index 753662290f..498849102a 100644 --- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj +++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj @@ -1,32 +1,23 @@  false - net8.0;net6.0 - netstandard2.1 + net6.0;net8.0 $(ObjFolder)$(Configuration)\$(AssemblyName)\ref\ $(BinFolder)$(Configuration)\$(AssemblyName)\ref\ $(OutputPath)\$(TargetFramework)\Microsoft.Data.SqlClient.xml Core $(BaseProduct) Debug;Release; netcoreapp - netstandard AnyCPU;x64;x86 - - - - - - - - + diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIStreams.Task.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIStreams.Task.cs deleted file mode 100644 index 399c43cb9b..0000000000 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIStreams.Task.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#if NETSTANDARD2_0 - -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Data.SqlClient.SNI -{ - // NetCore2.1: - // DO NOT OVERRIDE ValueTask versions of ReadAsync and WriteAsync because the underlying SslStream implements them - // by calling the Task versions which are already overridden meaning that if a caller uses Task WriteAsync this would - // call ValueTask WriteAsync which then called TaskWriteAsync introducing a lock cycle and never return - - internal sealed partial class SNISslStream - { - public override async Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) - { - await _readAsyncSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false); - try - { - return await base.ReadAsync(buffer, offset, count, cancellationToken).ConfigureAwait(false); - } - catch (System.Exception e) - { - SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNISslStream), EventType.ERR, "Internal Exception occurred while reading data: {0}", args0: e?.Message); - throw; - } - finally - { - _readAsyncSemaphore.Release(); - } - } - - public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) - { - await _writeAsyncSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false); - try - { - await base.WriteAsync(buffer, offset, count, cancellationToken).ConfigureAwait(false); - } - catch (System.Exception e) - { - SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNISslStream), EventType.ERR, "Internal Exception occurred while reading data: {0}", args0: e?.Message); - throw; - } - finally - { - _writeAsyncSemaphore.Release(); - } - } - } - - internal sealed partial class SNINetworkStream - { - public override async Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) - { - await _readAsyncSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false); - try - { - return await base.ReadAsync(buffer, offset, count, cancellationToken).ConfigureAwait(false); - } - catch (System.Exception e) - { - SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNISslStream), EventType.ERR, "Internal Exception occurred while reading data: {0}", args0: e?.Message); - throw; - } - finally - { - _readAsyncSemaphore.Release(); - } - } - - // Prevent the WriteAsync collisions by running the task in a Semaphore Slim - public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) - { - await _writeAsyncSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false); - try - { - await base.WriteAsync(buffer, offset, count, cancellationToken).ConfigureAwait(false); - } - catch (System.Exception e) - { - SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNISslStream), EventType.ERR, "Internal Exception occurred while reading data: {0}", args0: e?.Message); - throw; - } - finally - { - _writeAsyncSemaphore.Release(); - } - } - } -} - -#endif diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SslOverTdsStream.NetStandard.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SslOverTdsStream.NetStandard.cs deleted file mode 100644 index e411c2955e..0000000000 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SslOverTdsStream.NetStandard.cs +++ /dev/null @@ -1,227 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#if NETSTANDARD2_0 - -using System; -using System.Buffers; -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Data.SqlClient.SNI -{ - internal sealed partial class SslOverTdsStream : Stream - { - public override int Read(byte[] buffer, int offset, int count) - { - using (TrySNIEventScope.Create(nameof(SslOverTdsStream))) - { - if (!_encapsulate) - { - return _stream.Read(buffer, offset, count); - } - - if (_packetBytes > 0) - { - // there are queued bytes from a previous packet available - // work out how many of the remaining bytes we can consume - int wantedCount = Math.Min(count, _packetBytes); - int readCount = _stream.Read(buffer, offset, wantedCount); - if (readCount == 0) - { - // 0 means the connection was closed, tell the caller - return 0; - } - _packetBytes -= readCount; - return readCount; - } - else - { - byte[] headerBytes = ArrayPool.Shared.Rent(TdsEnums.HEADER_LEN); - Array.Clear(headerBytes, 0, headerBytes.Length); - - // fetch the packet header to determine how long the packet is - int headerBytesRead = 0; - do - { - int headerBytesReadIteration = _stream.Read(headerBytes, headerBytesRead, (TdsEnums.HEADER_LEN - headerBytesRead)); - if (headerBytesReadIteration == 0) - { - // 0 means the connection was closed, cleanup the rented array and then tell the caller - ArrayPool.Shared.Return(headerBytes, clearArray: true); - return 0; - } - headerBytesRead += headerBytesReadIteration; - } while (headerBytesRead < TdsEnums.HEADER_LEN); - - // read the packet data size from the header and store it in case it is needed for a subsequent call - _packetBytes = ((headerBytes[TdsEnums.HEADER_LEN_FIELD_OFFSET] << 8) | headerBytes[TdsEnums.HEADER_LEN_FIELD_OFFSET + 1]) - TdsEnums.HEADER_LEN; - - ArrayPool.Shared.Return(headerBytes, clearArray: true); - - // read as much from the packet as the caller can accept - int packetBytesRead = _stream.Read(buffer, offset, Math.Min(count, _packetBytes)); - _packetBytes -= packetBytesRead; - return packetBytesRead; - } - } - } - - public override async Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) - { - using (TrySNIEventScope.Create(nameof(SslOverTdsStream))) - { - if (!_encapsulate) - { - return await _stream.ReadAsync(buffer, offset, count, cancellationToken); - } - - if (_packetBytes > 0) - { - // there are queued bytes from a previous packet available - // work out how many of the remaining bytes we can consume - int wantedCount = Math.Min(count, _packetBytes); - int readCount = await _stream.ReadAsync(buffer, offset, wantedCount, cancellationToken); - if (readCount == 0) - { - // 0 means the connection was closed, tell the caller - return 0; - } - _packetBytes -= readCount; - return readCount; - } - else - { - byte[] headerBytes = ArrayPool.Shared.Rent(TdsEnums.HEADER_LEN); - Array.Clear(headerBytes, 0, headerBytes.Length); - - // fetch the packet header to determine how long the packet is - int headerBytesRead = 0; - do - { - int headerBytesReadIteration = await _stream.ReadAsync(headerBytes, headerBytesRead, (TdsEnums.HEADER_LEN - headerBytesRead), cancellationToken); - if (headerBytesReadIteration == 0) - { - // 0 means the connection was closed, cleanup the rented array and then tell the caller - ArrayPool.Shared.Return(headerBytes, clearArray: true); - return 0; - } - headerBytesRead += headerBytesReadIteration; - } while (headerBytesRead < TdsEnums.HEADER_LEN); - - // read the packet data size from the header and store it in case it is needed for a subsequent call - _packetBytes = ((headerBytes[TdsEnums.HEADER_LEN_FIELD_OFFSET] << 8) | headerBytes[TdsEnums.HEADER_LEN_FIELD_OFFSET + 1]) - TdsEnums.HEADER_LEN; - - ArrayPool.Shared.Return(headerBytes, clearArray: true); - - // read as much from the packet as the caller can accept - int packetBytesRead = await _stream.ReadAsync(buffer, offset, Math.Min(count, _packetBytes), cancellationToken); - _packetBytes -= packetBytesRead; - return packetBytesRead; - } - } - } - - public override void Write(byte[] buffer, int offset, int count) - { - using (TrySNIEventScope.Create(nameof(SslOverTdsStream))) - { - // During the SSL negotiation phase, SSL is tunnelled over TDS packet type 0x12. After - // negotiation, the underlying socket only sees SSL frames. - if (!_encapsulate) - { - _stream.Write(buffer, offset, count); - _stream.Flush(); - return; - } - - int remainingBytes = count; - int dataOffset = offset; - byte[] packetBuffer = null; - while (remainingBytes > 0) - { - int dataLength = Math.Min(PACKET_SIZE_WITHOUT_HEADER, remainingBytes); - int packetLength = TdsEnums.HEADER_LEN + dataLength; - remainingBytes -= dataLength; - - if (packetBuffer == null) - { - packetBuffer = ArrayPool.Shared.Rent(packetLength); - } - else if (packetBuffer.Length < packetLength) - { - ArrayPool.Shared.Return(packetBuffer, clearArray: true); - packetBuffer = ArrayPool.Shared.Rent(packetLength); - } - - SetupPreLoginPacketHeader(packetBuffer, dataLength, remainingBytes); - - Array.Copy(buffer, dataOffset, packetBuffer, TdsEnums.HEADER_LEN, dataLength); - - _stream.Write(packetBuffer, 0, packetLength); - _stream.Flush(); - - dataOffset += dataLength; - } - if (packetBuffer != null) - { - ArrayPool.Shared.Return(packetBuffer, clearArray: true); - } - } - } - - public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) - { - using (TrySNIEventScope.Create(nameof(SslOverTdsStream))) - { - if (!_encapsulate) - { - await _stream.WriteAsync(buffer, offset, count).ConfigureAwait(false); - Task flushTask = _stream.FlushAsync(); - if (flushTask.Status == TaskStatus.RanToCompletion) - { - await flushTask.ConfigureAwait(false); - } - return; - } - - int remainingBytes = count; - int dataOffset = offset; - byte[] packetBuffer = null; - while (remainingBytes > 0) - { - int dataLength = Math.Min(PACKET_SIZE_WITHOUT_HEADER, remainingBytes); - int packetLength = TdsEnums.HEADER_LEN + dataLength; - remainingBytes -= dataLength; - - if (packetBuffer == null) - { - packetBuffer = ArrayPool.Shared.Rent(packetLength); - } - else if (packetBuffer.Length < packetLength) - { - ArrayPool.Shared.Return(packetBuffer, clearArray: true); - packetBuffer = ArrayPool.Shared.Rent(packetLength); - } - - SetupPreLoginPacketHeader(packetBuffer, dataLength, remainingBytes); - - Array.Copy(buffer, dataOffset, packetBuffer, TdsEnums.HEADER_LEN, dataLength); - - await _stream.WriteAsync(packetBuffer, 0, packetLength, cancellationToken).ConfigureAwait(false); - await _stream.FlushAsync().ConfigureAwait(false); - - dataOffset += dataLength; - } - if (packetBuffer != null) - { - ArrayPool.Shared.Return(packetBuffer, clearArray: true); - } - } - } - } -} - -#endif diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.NetStandard.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.NetStandard.cs deleted file mode 100644 index 0fa64d0cef..0000000000 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.NetStandard.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#if NETSTANDARD2_0 - -namespace Microsoft.Data.SqlClient -{ - internal partial class SqlAuthenticationProviderManager - { - static SqlAuthenticationProviderManager() - { - Instance = new SqlAuthenticationProviderManager(); - SetDefaultAuthProviders(Instance); - } - } -} - -#endif diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.NetStandard.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.NetStandard.cs deleted file mode 100644 index ba50ca5d14..0000000000 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.NetStandard.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#if NETSTANDARD2_0 - -using System; -using System.Transactions; - -namespace Microsoft.Data.SqlClient -{ - internal sealed partial class SqlDelegatedTransaction : IPromotableSinglePhaseNotification - { - // Get the server-side Global Transaction Id from the PromotedDTCToken - // Skip first 4 bytes since they contain the version - private Guid GetGlobalTxnIdentifierFromToken() - { - byte[] txnGuid = new byte[16]; - Array.Copy(_connection.PromotedDTCToken, _globalTransactionsTokenVersionSizeInBytes, // Skip the version - txnGuid, 0, txnGuid.Length); - return new Guid(txnGuid); - } - } -} - -#endif diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.NetStandard.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.NetStandard.cs deleted file mode 100644 index 2327f92b72..0000000000 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.NetStandard.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#if NETSTANDARD2_0 - -using System; -using System.Buffers; -using System.Diagnostics; - -namespace Microsoft.Data.SqlClient -{ - internal sealed partial class TdsParser - { - internal static void FillGuidBytes(Guid guid, Span buffer) - { - byte[] bytes = guid.ToByteArray(); - bytes.AsSpan().CopyTo(buffer); - } - - internal static void FillDoubleBytes(double value, Span buffer) - { - byte[] bytes = BitConverter.GetBytes(value); - bytes.AsSpan().CopyTo(buffer); - } - - internal static void FillFloatBytes(float value, Span buffer) - { - byte[] bytes = BitConverter.GetBytes(value); - bytes.AsSpan().CopyTo(buffer); - } - - internal static Guid ConstructGuid(ReadOnlySpan bytes) - { - Debug.Assert(bytes.Length >= 16, "not enough bytes to set guid"); - byte[] temp = ArrayPool.Shared.Rent(16); - bytes.CopyTo(temp.AsSpan()); - Guid retval = new Guid(temp); - ArrayPool.Shared.Return(temp); - return retval; - } - } -} - -#endif diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveDelegate.NotSupported.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveDelegate.NotSupported.cs deleted file mode 100644 index 3c3afac335..0000000000 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveDelegate.NotSupported.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#if NETSTANDARD2_0 - -using System; -using System.Collections.Concurrent; - -namespace Microsoft.Data.SqlClient -{ - internal sealed partial class EnclaveDelegate - { - internal byte[] GetSerializedAttestationParameters( - SqlEnclaveAttestationParameters sqlEnclaveAttestationParameters, string enclaveType) - { - throw new PlatformNotSupportedException(); - } - - /// - /// Create a new enclave session - /// - /// attestation protocol - /// enclave type - /// The set of parameters required for enclave session. - /// attestation info from SQL Server - /// attestation parameters - /// A set of extra data needed for attesting the enclave. - /// The length of the extra data needed for attesting the enclave. - /// Indicates if this is a retry from a failed call. - internal void CreateEnclaveSession(SqlConnectionAttestationProtocol attestationProtocol, string enclaveType, EnclaveSessionParameters enclaveSessionParameters, - byte[] attestationInfo, SqlEnclaveAttestationParameters attestationParameters, byte[] customData, int customDataLength, bool isRetry) - { - throw new PlatformNotSupportedException(); - } - - internal void GetEnclaveSession(SqlConnectionAttestationProtocol attestationProtocol, string enclaveType, EnclaveSessionParameters enclaveSessionParameters, bool generateCustomData, bool isRetry, out SqlEnclaveSession sqlEnclaveSession, out byte[] customData, out int customDataLength) - { - throw new PlatformNotSupportedException(); - } - - internal EnclavePackage GenerateEnclavePackage(SqlConnectionAttestationProtocol attestationProtocol, ConcurrentDictionary keysTobeSentToEnclave, string queryText, string enclaveType, EnclaveSessionParameters enclaveSessionParameters, SqlConnection connection, SqlCommand command) - { - throw new PlatformNotSupportedException(); - } - - internal void InvalidateEnclaveSession(SqlConnectionAttestationProtocol attestationProtocol, string enclaveType, EnclaveSessionParameters enclaveSessionParameters, SqlEnclaveSession enclaveSession) - { - throw new PlatformNotSupportedException(); - } - - internal SqlEnclaveAttestationParameters GetAttestationParameters(SqlConnectionAttestationProtocol attestationProtocol, string enclaveType, string attestationUrl, byte[] customData, int customDataLength) - { - throw new PlatformNotSupportedException(); - } - } -} - -#endif diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlEnclaveAttestationParameters.NotSupported.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlEnclaveAttestationParameters.NotSupported.cs deleted file mode 100644 index 64d5d19655..0000000000 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlEnclaveAttestationParameters.NotSupported.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#if NETSTANDARD2_0 - -namespace Microsoft.Data.SqlClient -{ - /// - internal partial class SqlEnclaveAttestationParameters - { - /// - internal int Protocol { get; } - - /// - internal byte[] GetInput() - { - return null; - } - } -} - -#endif From 6f7fb1dbc77729273adb77a1f4952e28d83482c9 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 29 Jan 2024 11:52:32 +0100 Subject: [PATCH 04/25] Remove NETSTANDARD conditional compliation --- .../netcore/ref/Microsoft.Data.SqlClient.cs | 4 +- .../src/Microsoft.Data.SqlClient.csproj | 573 ++++++++++-------- .../Microsoft/Data/SqlClient/SNI/SNIHandle.cs | 6 - .../Microsoft/Data/SqlClient/SNI/SNIProxy.cs | 1 - ...ryptionCertificateStoreProvider.Windows.cs | 8 +- .../src/Microsoft/Data/SqlClient/TdsParser.cs | 4 +- .../Data/SqlTypes/SqlFileStream.Windows.cs | 4 - .../src/Microsoft/Data/SqlClient/TdsParser.cs | 4 +- .../ActiveDirectoryAuthenticationProvider.cs | 37 -- .../Data/SqlClient/SqlConnectionString.cs | 2 +- .../Data/SqlClient/SqlDependencyUtils.cs | 2 +- .../Data/SqlClient/SqlInternalConnection.cs | 2 +- .../src/System/Diagnostics/CodeAnalysis.cs | 54 -- 13 files changed, 322 insertions(+), 379 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs index ba7a1cd534..a0acf34a33 100644 --- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs +++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs @@ -478,7 +478,7 @@ public static partial class SqlClientMetaDataCollectionNames /// public static readonly string StructuredTypeMembers; } -#if NETCOREAPP || NETSTANDARD2_1_OR_GREATER +#if NETCOREAPP /// public enum SqlConnectionAttestationProtocol { @@ -1017,7 +1017,7 @@ public SqlConnectionStringBuilder(string connectionString) { } [System.ComponentModel.DisplayNameAttribute("Data Source")] [System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)] public string DataSource { get { throw null; } set { } } -#if NETCOREAPP || NETSTANDARD2_1_OR_GREATER +#if NETCOREAPP /// [System.ComponentModel.DisplayNameAttribute("Attestation Protocol")] [System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)] diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj index afc2fc0d45..bfaf0e96da 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj @@ -30,49 +30,6 @@ - - Common\CoreLib\System\Threading\Tasks\TaskToApm.cs - - - Common\Microsoft\Data\ProviderBase\DbConnectionClosed.cs - - - Common\Microsoft\Data\ProviderBase\DbConnectionFactory.cs - - - Common\Microsoft\Data\ProviderBase\DbConnectionInternal.cs - - - Common\System\Net\ContextFlagsPal.cs - - - Common\System\Net\DebugCriticalHandleMinusOneIsInvalid.cs - - - Common\System\Net\DebugSafeHandle.cs - - - Common\System\Net\InternalException.cs - - - Common\System\Net\Logging\DebugThreadTracking.cs - - - Common\System\Net\Logging\NetEventSource.Common.cs - - - Common\System\Net\NegotiationInfoClass.cs - - - Common\System\Net\Security\SecurityBuffer.cs - - - Common\System\Net\Security\SecurityBufferType.cs - - - Common\System\Net\SecurityStatusPal.cs - - Microsoft\Data\Common\ActivityCorrelator.cs @@ -124,9 +81,6 @@ Microsoft\Data\ProviderBase\DbMetaDataFactory.cs - - Common\Microsoft\Data\ProviderBase\DbReferenceCollection.cs - Microsoft\Data\ProviderBase\FieldNameLookup.cs @@ -151,18 +105,12 @@ Microsoft\Data\SqlClient\ActiveDirectoryAuthenticationTimeoutRetryHelper.cs - - Microsoft\Data\SqlClient\AlwaysEncryptedEnclaveProviderUtils.cs - Microsoft\Data\SqlClient\ApplicationIntent.cs Microsoft\Data\SqlClient\AssemblyRef.cs - - Microsoft\Data\SqlClient\AzureAttestationBasedEnclaveProvider.cs - Microsoft\Data\SqlClient\ColumnEncryptionKeyInfo.cs @@ -175,27 +123,12 @@ Microsoft\Data\SqlClient\EnclaveDelegate.cs - - Microsoft\Data\SqlClient\EnclaveDelegate.Crypto.cs - - - Microsoft\Data\SqlClient\EnclaveDelegate.NotSupported.cs - Microsoft\Data\SqlClient\EnclavePackage.cs - - Microsoft\Data\SqlClient\EnclaveProviderBase.cs - - - Microsoft\Data\SqlClient\EnclaveSessionCache.cs - Microsoft\Data\SqlClient\LocalAppContextSwitches.cs - - Microsoft\Data\SqlClient\NoneAttestationEnclaveProvider.cs - Microsoft\Data\SqlClient\OnChangedEventHandler.cs @@ -244,6 +177,9 @@ Microsoft\Data\SqlClient\RowsCopiedEventHandler.cs + + Microsoft\Data\SqlClient\SqlSequentialTextReader.cs + Microsoft\Data\SqlClient\Server\ExtendedClrTypeCode.cs @@ -310,8 +246,8 @@ Microsoft\Data\SqlClient\Server\SqlRecordBuffer.cs - - Microsoft\Data\SqlClient\Server\SqlSer.cs + + Microsoft\Data\SqlClient\SqlTransaction.Common.cs Microsoft\Data\SqlClient\Server\ValueUtilsSmi.cs @@ -337,6 +273,9 @@ Microsoft\Data\SqlClient\SqlAuthenticationProvider.cs + + Microsoft\Data\SqlClient\SqlBuffer.cs + Microsoft\Data\SqlClient\SqlAuthenticationToken.cs @@ -346,15 +285,9 @@ Microsoft\Data\SqlClient\SqlBatchCommand.cs - - Microsoft\Data\SqlClient\SqlBatchCommand.Net8OrGreater.cs - Microsoft\Data\SqlClient\SqlBatchCommandCollection.cs - - Microsoft\Data\SqlClient\SqlBuffer.cs - Microsoft\Data\SqlClient\SqlBulkCopyColumnMapping.cs @@ -400,12 +333,12 @@ Microsoft\Data\SqlClient\SqlCollation.cs - - Microsoft\Data\SqlClient\SqlCommandBuilder.cs - Microsoft\Data\SqlClient\SqlColumnEncryptionKeyStoreProvider.cs + + Microsoft\Data\SqlClient\SqlCommandBuilder.cs + Microsoft\Data\SqlClient\SqlCommandSet.cs @@ -451,15 +384,6 @@ Microsoft\Data\SqlClient\SqlDependencyUtils.AppDomain.cs - - Microsoft\Data\SqlClient\SqlDependencyUtils.AssemblyLoadContext.cs - - - Microsoft\Data\SqlClient\SqlEnclaveAttestationParameters.Crypto.cs - - - Microsoft\Data\SqlClient\SqlEnclaveAttestationParameters.NotSupported.cs - Microsoft\Data\SqlClient\SqlEnclaveSession.cs @@ -541,15 +465,12 @@ Microsoft\Data\SqlClient\SqlSequentialStream.cs - - Microsoft\Data\SqlClient\SqlSequentialTextReader.cs + + Microsoft\Data\SqlClient\Server\SqlSer.cs Microsoft\Data\SqlClient\SqlStatistics.cs - - Microsoft\Data\SqlClient\SqlStream.cs - Microsoft\Data\SqlClient\SqlSymmetricKeyCache.cs @@ -559,27 +480,12 @@ Microsoft\Data\SqlClient\SqlUtil.cs - - Microsoft\Data\SqlClient\SqlTransaction.Common.cs - - - Microsoft\Data\SqlClient\SSPI\ManagedSSPIContextProvider.cs - - - Microsoft\Data\SqlClient\SSPI\NegotiateSSPIContextProvider.cs - - - Microsoft\Data\SqlClient\SSPI\SSPIContextProvider.cs - Microsoft\Data\SqlClient\TdsEnums.cs Microsoft\Data\SqlClient\TdsParameterSetter.cs - - Microsoft\Data\SqlClient\TdsParser.cs - Microsoft\Data\SqlClient\TdsParserStateObject.cs @@ -595,19 +501,16 @@ Microsoft\Data\SqlClient\TdsValueSetter.cs - - Microsoft\Data\SqlClient\VirtualSecureModeEnclaveProvider.cs - - - Microsoft\Data\SqlClient\VirtualSecureModeEnclaveProviderBase.cs - Microsoft\Data\SQLTypes\SQLResource.cs Microsoft\Data\SqlTypes\SqlTypeWorkarounds.cs - + + Microsoft\Data\SqlClient\SqlStream.cs + + Resources\ResCategoryAttribute.cs @@ -616,23 +519,132 @@ Common\System\Diagnostics\CodeAnalysis.cs - + + Microsoft\Data\SqlClient\SSPI\ManagedSSPIContextProvider.cs + + + Microsoft\Data\SqlClient\SSPI\NegotiateSSPIContextProvider.cs + + + Microsoft\Data\SqlClient\SSPI\SSPIContextProvider.cs + + + Microsoft\Data\SqlClient\TdsParser.cs + + + Microsoft\Data\ProviderBase\DbReferenceCollection.cs + + + + + + + + Microsoft\Data\SqlClient\EnclaveDelegate.NotSupported.cs + + + Microsoft\Data\SqlClient\SqlEnclaveAttestationParameters.NotSupported.cs + + + + + + + + + + + + Microsoft\Data\SqlClient\AlwaysEncryptedEnclaveProviderUtils.cs + + + Microsoft\Data\SqlClient\AzureAttestationBasedEnclaveProvider.cs + + + Microsoft\Data\SqlClient\EnclaveDelegate.Crypto.cs + + + Microsoft\Data\SqlClient\EnclaveProviderBase.cs + + + Microsoft\Data\SqlClient\EnclaveSessionCache.cs + + + Microsoft\Data\SqlClient\SqlEnclaveAttestationParameters.Crypto.cs + + + Microsoft\Data\SqlClient\VirtualSecureModeEnclaveProvider.cs + + + Microsoft\Data\SqlClient\NoneAttestationEnclaveProvider.cs + + + Microsoft\Data\SqlClient\VirtualSecureModeEnclaveProviderBase.cs + + + + + + + + + + + + + Microsoft\Data\SqlClient\SqlDependencyUtils.AssemblyLoadContext.cs + + + + + + + Resources\StringsHelper.cs + + + Resources\Strings.Designer.cs + True + True + Strings.resx + + + Resources\Strings.resx + Microsoft.Data.SqlClient.Resources.Strings.resources + ResXFileCodeGenerator + Strings.Designer.cs + System + + + Resources\%(RecursiveDir)%(Filename)%(Extension) + + + + + Common\CoreLib\System\Threading\Tasks\TaskToApm.cs + + + Common\Microsoft\Data\ProviderBase\DbConnectionClosed.cs + + + Common\Microsoft\Data\ProviderBase\DbConnectionFactory.cs + + + Common\Microsoft\Data\ProviderBase\DbConnectionInternal.cs + + - - - @@ -642,26 +654,16 @@ - - - - - + - - - - - - @@ -669,55 +671,68 @@ - - - - + + + - - - - Common\CoreLib\Interop\Windows\kernel32\Interop.FileTypes.cs + + Microsoft\Data\Common\AdapterUtil.Windows.cs - - Common\CoreLib\Interop\Windows\kernel32\Interop.GetFileType_SafeHandle.cs + + Microsoft\Data\Sql\SqlDataSourceEnumeratorNativeHelper.cs - - Common\CoreLib\Interop\Windows\Kernel32\Interop.CloseHandle.cs + + Microsoft\Data\Sql\SqlDataSourceEnumerator.Windows.cs + + + + + + Microsoft\Data\SqlClient\TdsParserSafeHandles.Windows.cs + + + + + + Microsoft\Data\Common\AdapterUtil.Unix.cs + + + + + + + + + + + + + Common\CoreLib\Interop\Windows\kernel32\Interop.FileTypes.cs + + + Common\CoreLib\Interop\Windows\kernel32\Interop.GetFileType_SafeHandle.cs Common\CoreLib\Interop\Windows\kernel32\Interop.SetThreadErrorMode.cs - - Common\CoreLib\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs - Common\CoreLib\System\IO\PathInternal.Windows.cs - - Common\Interop\Windows\Crypt32\Interop.certificates.cs - - - Common\Interop\Windows\Crypt32\Interop.certificates_types.cs - Common\Interop\Windows\Interop.Errors.cs - - Common\Interop\Windows\Interop.Libraries.cs - Common\Interop\Windows\Interop.UNICODE_STRING.cs @@ -727,12 +742,6 @@ Common\Interop\Windows\Kernel32\Interop.DeviceIoControl.cs - - Common\Interop\Windows\kernel32\Interop.FreeLibrary.cs - - - Common\Interop\Windows\kernel32\Interop.GetProcAddress.cs - Common\Interop\Windows\Kernel32\Interop.IoControlCodeAccess.cs @@ -751,6 +760,89 @@ Common\Interop\Windows\NtDll\Interop.RtlNtStatusToDosError.cs + + + + + + + + + + + + + + + + + + + + + + Common\Interop\Windows\kernel32\Interop.LoadLibraryEx.cs + + + Microsoft\Data\SqlClient\SSPI\NativeSSPIContextProvider.cs + + + + + + + + + + + Common\CoreLib\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs + + + Common\Interop\Windows\kernel32\Interop.FreeLibrary.cs + + + Common\Interop\Windows\kernel32\Interop.GetProcAddress.cs + + + + + + + Common\Interop\Windows\Interop.Libraries.cs + + + + + + Common\System\Net\InternalException.cs + + + Common\System\Net\Logging\NetEventSource.Common.cs + + + + + + + + + + + + + + + + + + Common\CoreLib\Interop\Windows\Kernel32\Interop.CloseHandle.cs + + + Common\Interop\Windows\Crypt32\Interop.certificates.cs + + + Common\Interop\Windows\Crypt32\Interop.certificates_types.cs + Common\Interop\Windows\SChannel\Interop.SecPkgContext_ApplicationProtocol.cs @@ -760,6 +852,30 @@ Common\Interop\Windows\SChannel\SecPkgContext_ConnectionInfo.cs + + Common\System\Collections\Generic\BidirectionalDictionary.cs + + + Common\System\Net\ContextFlagsAdapterPal.Windows.cs + + + Common\System\Net\DebugCriticalHandleZeroOrMinusOneIsInvalid.cs + + + Common\System\Net\Security\SecurityContextTokenHandle.cs + + + Common\System\Net\SecurityStatusAdapterPal.Windows.cs + + + Common\System\Net\Security\NegotiateStreamPal.Windows.cs + + + Common\System\Net\Security\NetEventSource.Security.cs + + + Common\System\Net\Security\NetEventSource.Security.Windows.cs + Common\Interop\Windows\sspicli\GlobalSSPI.cs @@ -805,56 +921,37 @@ Common\Interop\Windows\sspicli\SSPIWrapper.cs - - Common\System\Collections\Generic\BidirectionalDictionary.cs - - - Common\System\Net\ContextFlagsAdapterPal.Windows.cs - - - Common\System\Net\DebugCriticalHandleZeroOrMinusOneIsInvalid.cs - - - Common\System\Net\Security\NegotiateStreamPal.Windows.cs - - - Common\System\Net\Security\NetEventSource.Security.cs + + + + + Common\System\Net\ContextFlagsPal.cs - - Common\System\Net\Security\NetEventSource.Security.Windows.cs + + Common\System\Net\DebugCriticalHandleMinusOneIsInvalid.cs - - Common\System\Net\Security\SecurityContextTokenHandle.cs + + Common\System\Net\DebugSafeHandle.cs - - Common\System\Net\SecurityStatusAdapterPal.Windows.cs + + Common\System\Net\Logging\DebugThreadTracking.cs - - - Microsoft\Data\Common\AdapterUtil.Windows.cs + + Common\System\Net\NegotiationInfoClass.cs - - Microsoft\Data\Sql\SqlDataSourceEnumeratorNativeHelper.cs + + Common\System\Net\Security\SecurityBuffer.cs - - Microsoft\Data\Sql\SqlDataSourceEnumerator.Windows.cs + + Common\System\Net\Security\SecurityBufferType.cs - - Microsoft\Data\SqlClient\TdsParserSafeHandles.Windows.cs + + Common\System\Net\SecurityStatusPal.cs - - - - - - - - - + - - - + + Common\Interop\Unix\Interop.Libraries.cs @@ -888,82 +985,24 @@ Common\System\Net\Security\NegotiateStreamPal.Unix.cs - - - Microsoft\Data\Common\AdapterUtil.Unix.cs - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - Common\Interop\Windows\kernel32\Interop.LoadLibraryEx.cs - - - Microsoft\Data\SqlClient\SSPI\NativeSSPIContextProvider.cs + + + Microsoft\Data\SqlClient\SqlBatchCommand.Net8OrGreater.cs - - - - - - - - + + + + - - Resources\StringsHelper.cs - - - Resources\Strings.Designer.cs - True - True - Strings.resx - - - Resources\Strings.resx - Microsoft.Data.SqlClient.Resources.Strings.resources - ResXFileCodeGenerator - Strings.Designer.cs - System - - - Resources\%(RecursiveDir)%(Filename)%(Extension) - Microsoft.Data.SqlClient.SqlMetaData.xml - - - - - - diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIHandle.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIHandle.cs index 354ce3eff5..515686f6a3 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIHandle.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIHandle.cs @@ -19,7 +19,6 @@ internal abstract class SNIHandle { protected static readonly SslProtocols s_supportedProtocols = SslProtocols.None; -#if !NETSTANDARD2_0 protected static readonly List s_tdsProtocols = new List(1) { new(TdsEnums.TDS8_Protocol) }; protected static async Task AuthenticateAsClientAsync(SslStream sslStream, string serverNameIndication, X509CertificateCollection certificate, CancellationToken token) @@ -32,15 +31,10 @@ protected static async Task AuthenticateAsClientAsync(SslStream sslStream, strin }; await sslStream.AuthenticateAsClientAsync(sslClientOptions, token); } -#endif protected static void AuthenticateAsClient(SslStream sslStream, string serverNameIndication, X509CertificateCollection certificate) { -#if !NETSTANDARD2_0 AuthenticateAsClientAsync(sslStream, serverNameIndication, certificate, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult(); -#else - throw new NotSupportedException(Strings.SQL_TDS8_NotSupported_Netstandard2_0); -#endif } /// diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs index 3df369a2f6..33fa3c06e2 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs @@ -524,7 +524,6 @@ private void PopulateProtocol() internal static string GetLocalDBInstance(string dataSource, out bool error) { string instanceName = null; - // ReadOnlySpan is not supported in netstandard 2.0, but installing System.Memory solves the issue ReadOnlySpan input = dataSource.AsSpan().TrimStart(); error = false; // NetStandard 2.0 does not support passing a string to ReadOnlySpan diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs index 0036fca41e..0d5d839d51 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs @@ -81,7 +81,13 @@ public override byte[] DecryptColumnEncryptionKey(string masterKeyPath, string e X509Certificate2 certificate = GetCertificateByPath(masterKeyPath, isSystemOp: true); RSA RSAPublicKey = certificate.GetRSAPublicKey(); - int keySizeInBytes= RSAPublicKey.KeySize / 8; + int keySizeInBytes; +#if NETCOREAPP + DSA DSAPublicKey = certificate.GetDSAPublicKey(); + keySizeInBytes = RSAPublicKey is not null ? RSAPublicKey.KeySize / 8 : DSAPublicKey.KeySize / 8; +#else + keySizeInBytes= RSAPublicKey.KeySize / 8; +#endif // Validate and decrypt the EncryptedColumnEncryptionKey // Format is diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs index 4d731102fe..e89e5ef92e 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs @@ -7568,7 +7568,7 @@ private Task WriteEncodingChar(string s, Encoding encoding, TdsParserStateObject private byte[] SerializeEncodingChar(string s, int numChars, int offset, Encoding encoding) { -#if NETFRAMEWORK || NETSTANDARD2_0 +#if NETFRAMEWORK char[] charData; byte[] byteData = null; @@ -7605,7 +7605,7 @@ private Task WriteEncodingChar(string s, int numChars, int offset, Encoding enco } else { -#if NETFRAMEWORK || NETSTANDARD2_0 +#if NETFRAMEWORK char[] charData = s.ToCharArray(offset, numChars); byte[] byteData = encoding.GetBytes(charData, 0, numChars); Debug.Assert(byteData != null, "no data from encoding"); diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlTypes/SqlFileStream.Windows.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlTypes/SqlFileStream.Windows.cs index cfbd2139eb..78682e917f 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlTypes/SqlFileStream.Windows.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlTypes/SqlFileStream.Windows.cs @@ -693,11 +693,7 @@ static private string InitializeNtPath(string path) // Ensure we have validated and normalized the path before AssertPathFormat(path); string uniqueId = Guid.NewGuid().ToString("N"); -#if NETSTANDARD - return System.IO.PathInternal.IsDeviceUNC(path.AsSpan()) -#else return System.IO.PathInternal.IsDeviceUNC(path) -#endif ? string.Format(CultureInfo.InvariantCulture, @"{0}\{1}", path.Replace(@"\\.", @"\??"), uniqueId) : string.Format(CultureInfo.InvariantCulture, @"\??\UNC\{0}\{1}", path.Trim('\\'), uniqueId); } diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs index 6d49a79051..3012a87bec 100644 --- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs +++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs @@ -8340,7 +8340,7 @@ private Task WriteEncodingChar(string s, Encoding encoding, TdsParserStateObject private byte[] SerializeEncodingChar(string s, int numChars, int offset, Encoding encoding) { -#if NETFRAMEWORK || NETSTANDARD2_0 +#if NETFRAMEWORK char[] charData; byte[] byteData = null; @@ -8377,7 +8377,7 @@ private Task WriteEncodingChar(string s, int numChars, int offset, Encoding enco } else { -#if NETFRAMEWORK || NETSTANDARD2_0 +#if NETFRAMEWORK var charData = s.ToCharArray(offset, numChars); var byteData = encoding.GetBytes(charData, 0, numChars); Debug.Assert(byteData != null, "no data from encoding"); diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.cs index 01f265cf50..75b55847f7 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.cs @@ -100,13 +100,6 @@ public override void BeforeUnload(SqlAuthenticationMethod authentication) _logger.LogInfo(_type, "BeforeUnload", $"being unloaded from SqlAuthProviders for {authentication}."); } -#if NETSTANDARD - private Func _parentActivityOrWindowFunc = null; - - /// - public void SetParentActivityOrWindowFunc(Func parentActivityOrWindowFunc) => this._parentActivityOrWindowFunc = parentActivityOrWindowFunc; -#endif - #if NETFRAMEWORK private Func _iWin32WindowFunc = null; @@ -223,9 +216,6 @@ public override async Task AcquireTokenAsync(SqlAuthenti PublicClientAppKey pcaKey = new PublicClientAppKey(parameters.Authority, redirectUri, _applicationClientId #if NETFRAMEWORK , _iWin32WindowFunc -#endif -#if NETSTANDARD - , _parentActivityOrWindowFunc #endif ); @@ -491,18 +481,6 @@ private IPublicClientApplication CreateClientAppInstance(PublicClientAppKey publ { IPublicClientApplication publicClientApplication; -#if NETSTANDARD - if (_parentActivityOrWindowFunc != null) - { - publicClientApplication = PublicClientApplicationBuilder.Create(publicClientAppKey._applicationClientId) - .WithAuthority(publicClientAppKey._authority) - .WithClientName(Common.DbConnectionStringDefaults.ApplicationName) - .WithClientVersion(Common.ADP.GetAssemblyVersion().ToString()) - .WithRedirectUri(publicClientAppKey._redirectUri) - .WithParentActivityOrWindow(_parentActivityOrWindowFunc) - .Build(); - } -#endif #if NETFRAMEWORK if (_iWin32WindowFunc != null) { @@ -538,16 +516,10 @@ internal class PublicClientAppKey #if NETFRAMEWORK public readonly Func _iWin32WindowFunc; #endif -#if NETSTANDARD - public readonly Func _parentActivityOrWindowFunc; -#endif public PublicClientAppKey(string authority, string redirectUri, string applicationClientId #if NETFRAMEWORK , Func iWin32WindowFunc -#endif -#if NETSTANDARD - , Func parentActivityOrWindowFunc #endif ) { @@ -556,9 +528,6 @@ public PublicClientAppKey(string authority, string redirectUri, string applicati _applicationClientId = applicationClientId; #if NETFRAMEWORK _iWin32WindowFunc = iWin32WindowFunc; -#endif -#if NETSTANDARD - _parentActivityOrWindowFunc = parentActivityOrWindowFunc; #endif } @@ -571,9 +540,6 @@ public override bool Equals(object obj) && string.CompareOrdinal(_applicationClientId, pcaKey._applicationClientId) == 0 #if NETFRAMEWORK && pcaKey._iWin32WindowFunc == _iWin32WindowFunc -#endif -#if NETSTANDARD - && pcaKey._parentActivityOrWindowFunc == _parentActivityOrWindowFunc #endif ); } @@ -583,9 +549,6 @@ public override bool Equals(object obj) public override int GetHashCode() => Tuple.Create(_authority, _redirectUri, _applicationClientId #if NETFRAMEWORK , _iWin32WindowFunc -#endif -#if NETSTANDARD - , _parentActivityOrWindowFunc #endif ).GetHashCode(); } diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionString.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionString.cs index 690a4e810a..73de1ad4f7 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionString.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionString.cs @@ -1024,7 +1024,7 @@ internal ApplicationIntent ConvertValueToApplicationIntent() // ArgumentException and other types are raised as is (no wrapping) } -#if NETCOREAPP || NETSTANDARD +#if NETCOREAPP internal void ThrowUnsupportedIfKeywordSet(string keyword) { if (ContainsKey(keyword)) diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyUtils.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyUtils.cs index 506b45faac..3aa1697d03 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyUtils.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyUtils.cs @@ -107,7 +107,7 @@ private SqlDependencyPerAppDomainDispatcher() } } -#if NETCOREAPP || NETSTANDARD +#if NETCOREAPP partial void SubscribeToAppDomainUnload(); partial void SubscribeToAssemblyLoadContextUnload(); diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalConnection.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalConnection.cs index e6faafc405..25e1808e56 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalConnection.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalConnection.cs @@ -27,7 +27,7 @@ internal abstract class SqlInternalConnection : DbConnectionInternal private bool _isGlobalTransactionEnabledForServer; // Whether Global Transactions are enabled for this Azure SQL DB Server private static readonly Guid s_globalTransactionTMID = new("1c742caf-6680-40ea-9c26-6b6846079764"); // ID of the Non-MSDTC, Azure SQL DB Transaction Manager -#if NETCOREAPP || NETSTANDARD +#if NETCOREAPP internal SqlCommand.ExecuteReaderAsyncCallContext CachedCommandExecuteReaderAsyncContext; internal SqlCommand.ExecuteNonQueryAsyncCallContext CachedCommandExecuteNonQueryAsyncContext; internal SqlCommand.ExecuteXmlReaderAsyncCallContext CachedCommandExecuteXmlReaderAsyncContext; diff --git a/src/Microsoft.Data.SqlClient/src/System/Diagnostics/CodeAnalysis.cs b/src/Microsoft.Data.SqlClient/src/System/Diagnostics/CodeAnalysis.cs index e62544d06d..1c021b459a 100644 --- a/src/Microsoft.Data.SqlClient/src/System/Diagnostics/CodeAnalysis.cs +++ b/src/Microsoft.Data.SqlClient/src/System/Diagnostics/CodeAnalysis.cs @@ -4,60 +4,6 @@ namespace System.Diagnostics.CodeAnalysis { -#if NETSTANDARD2_0 - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)] - internal sealed class AllowNullAttribute : Attribute - { - } - - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)] - internal sealed class DisallowNullAttribute : Attribute - { - } - - [AttributeUsage(AttributeTargets.Method)] - internal sealed class DoesNotReturnAttribute : Attribute - { - } - - [AttributeUsage(AttributeTargets.Parameter)] - internal sealed class DoesNotReturnIfAttribute : Attribute - { - public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue; - public bool ParameterValue { get; } - } - - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)] - internal sealed class MaybeNullAttribute : Attribute - { - } - - [AttributeUsage(AttributeTargets.Parameter)] - internal sealed class MaybeNullWhenAttribute : Attribute - { - public MaybeNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; - public bool ReturnValue { get; } - } - - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)] - internal sealed class NotNullAttribute : Attribute - { - } - - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true)] - internal sealed class NotNullIfNotNullAttribute : Attribute - { - public NotNullIfNotNullAttribute(string parameterName) => ParameterName = parameterName; - public string ParameterName { get; } - } - - [AttributeUsage(AttributeTargets.Parameter)] - internal sealed class NotNullWhenAttribute : Attribute - { - public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; - public bool ReturnValue { get; } - } -#endif #if !NET6_0_OR_GREATER [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true, Inherited = false)] From aa9db90a4c7735cb8ec8a7b251dfff285342de0c Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 29 Jan 2024 13:45:22 +0100 Subject: [PATCH 05/25] Product builds now --- build.proj | 14 -- ...waysEncrypted.AzureKeyVaultProvider.csproj | 1 + tools/props/Versions.props | 5 - tools/specs/Microsoft.Data.SqlClient.nuspec | 133 +++--------------- 4 files changed, 24 insertions(+), 129 deletions(-) diff --git a/build.proj b/build.proj index d500f48886..89b46fb761 100644 --- a/build.proj +++ b/build.proj @@ -53,7 +53,6 @@ - @@ -62,7 +61,6 @@ - @@ -219,12 +217,6 @@ - - - - - - @@ -232,10 +224,4 @@ - - - - - - diff --git a/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj b/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj index eb08db41c2..b3b62afa6e 100644 --- a/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj +++ b/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj @@ -1,5 +1,6 @@  + net462;net6.0 Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider AzureKeyVaultProvider diff --git a/tools/props/Versions.props b/tools/props/Versions.props index 222ad1c1e6..8877dc2078 100644 --- a/tools/props/Versions.props +++ b/tools/props/Versions.props @@ -48,11 +48,6 @@ 5.0.0 6.0.0 - - - 4.3.0 - 6.0.1 - [1.35.0,2.0.0) diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec index c2c4353999..a51df08bd0 100644 --- a/tools/specs/Microsoft.Data.SqlClient.nuspec +++ b/tools/specs/Microsoft.Data.SqlClient.nuspec @@ -31,8 +31,8 @@ When using NuGet 3.x this package requires at least version 3.4. - - + + @@ -42,8 +42,8 @@ When using NuGet 3.x this package requires at least version 3.4. - - + + @@ -52,47 +52,12 @@ When using NuGet 3.x this package requires at least version 3.4. - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -111,14 +76,6 @@ When using NuGet 3.x this package requires at least version 3.4. - - - - - - - - @@ -137,27 +94,29 @@ When using NuGet 3.x this package requires at least version 3.4. + + - - - - - - - - - - + + + + + + + + + + - - - + + + @@ -194,44 +153,9 @@ When using NuGet 3.x this package requires at least version 3.4. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -244,16 +168,5 @@ When using NuGet 3.x this package requires at least version 3.4. - - - - - - - - - - - From 4a4f29e7f65907042483ad0066fc96ee4c350325 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 29 Jan 2024 14:18:45 +0100 Subject: [PATCH 06/25] Make tests build from command line --- ...t.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj | 1 - .../tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj | 1 - .../Microsoft.Data.SqlClient.ManualTesting.Tests.csproj | 1 - 3 files changed, 3 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj b/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj index b3b62afa6e..eb08db41c2 100644 --- a/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj +++ b/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj @@ -1,6 +1,5 @@  - net462;net6.0 Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider AzureKeyVaultProvider diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj index b89cb6e7b8..ce0215fb54 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj @@ -1,6 +1,5 @@  - net6.0;net8.0;net462 false FunctionalTests netfx diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj index e3fae3cf5c..539d83bb15 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj @@ -1,6 +1,5 @@  - net6.0;net8.0;net462 {45DB5F86-7AE3-45C6-870D-F9357B66BDB5} ManualTests netfx From 84dd761fb5d77b2a2ccb1897efc0545969aeb8f3 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 29 Jan 2024 14:28:50 +0100 Subject: [PATCH 07/25] add TODOs --- .../netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs | 1 + .../netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs index 964d332ae4..45400e67b3 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs @@ -343,6 +343,7 @@ internal static IPAddress[] GetDnsIpAddresses(string serverName, TimeoutTimer ti args1: remainingTimeout); using CancellationTokenSource cts = new CancellationTokenSource(remainingTimeout); // using this overload to support netstandard + //TODO Refactor? Task task = Dns.GetHostAddressesAsync(serverName); task.ConfigureAwait(false); task.Wait(cts.Token); diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs index 33fa3c06e2..354eddfe90 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs @@ -527,6 +527,7 @@ internal static string GetLocalDBInstance(string dataSource, out bool error) ReadOnlySpan input = dataSource.AsSpan().TrimStart(); error = false; // NetStandard 2.0 does not support passing a string to ReadOnlySpan + //TODO Refactor? int index = input.IndexOf(LocalDbHost.AsSpan().Trim(), StringComparison.InvariantCultureIgnoreCase); if (input.StartsWith(LocalDbHost_NP.AsSpan().Trim(), StringComparison.InvariantCultureIgnoreCase)) { From ce651a6bbc0c3e1cee6d8ec4d40444d47312dc96 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Tue, 30 Jan 2024 07:52:13 +0100 Subject: [PATCH 08/25] Remove ref from nuspec --- tools/specs/Microsoft.Data.SqlClient.nuspec | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec index a51df08bd0..f6fb8826b3 100644 --- a/tools/specs/Microsoft.Data.SqlClient.nuspec +++ b/tools/specs/Microsoft.Data.SqlClient.nuspec @@ -115,12 +115,10 @@ When using NuGet 3.x this package requires at least version 3.4. - - From 12e5697930c95bb92e7f5eeaf708deecf0ecd53c Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Tue, 30 Jan 2024 13:54:28 +0100 Subject: [PATCH 09/25] Fix tests --- .../tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj index ce0215fb54..a347780912 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj @@ -128,6 +128,7 @@ + From dfc690daf368e27aaf8b152ea120d34bffc0c1f9 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Tue, 30 Jan 2024 13:58:22 +0100 Subject: [PATCH 10/25] Fix bad merge --- tools/specs/Microsoft.Data.SqlClient.nuspec | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec index f6fb8826b3..a9ea7f00fc 100644 --- a/tools/specs/Microsoft.Data.SqlClient.nuspec +++ b/tools/specs/Microsoft.Data.SqlClient.nuspec @@ -92,15 +92,6 @@ When using NuGet 3.x this package requires at least version 3.4. - - - - - - - - - From fd69a1da097d61877db616b0cf51f7cd688bd57d Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 4 Mar 2024 13:37:21 +0100 Subject: [PATCH 11/25] Fix bad merge --- ...SqlColumnEncryptionCertificateStoreProvider.Windows.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs index 0d5d839d51..0036fca41e 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs @@ -81,13 +81,7 @@ public override byte[] DecryptColumnEncryptionKey(string masterKeyPath, string e X509Certificate2 certificate = GetCertificateByPath(masterKeyPath, isSystemOp: true); RSA RSAPublicKey = certificate.GetRSAPublicKey(); - int keySizeInBytes; -#if NETCOREAPP - DSA DSAPublicKey = certificate.GetDSAPublicKey(); - keySizeInBytes = RSAPublicKey is not null ? RSAPublicKey.KeySize / 8 : DSAPublicKey.KeySize / 8; -#else - keySizeInBytes= RSAPublicKey.KeySize / 8; -#endif + int keySizeInBytes= RSAPublicKey.KeySize / 8; // Validate and decrypt the EncryptedColumnEncryptionKey // Format is From 9cebcb297ff080315607a1a175703d277f8459a5 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 4 Mar 2024 14:07:50 +0100 Subject: [PATCH 12/25] Remove file fix bad merge --- ...yzerExceptionList.analyzerdata.netstandard | 44 ------------------- .../Microsoft.Data.SqlClient.Tests.csproj | 4 +- 2 files changed, 3 insertions(+), 45 deletions(-) delete mode 100644 src/Microsoft.Data.SqlClient/netcore/src/PinvokeAnalyzerExceptionList.analyzerdata.netstandard diff --git a/src/Microsoft.Data.SqlClient/netcore/src/PinvokeAnalyzerExceptionList.analyzerdata.netstandard b/src/Microsoft.Data.SqlClient/netcore/src/PinvokeAnalyzerExceptionList.analyzerdata.netstandard deleted file mode 100644 index 5c0648966d..0000000000 --- a/src/Microsoft.Data.SqlClient/netcore/src/PinvokeAnalyzerExceptionList.analyzerdata.netstandard +++ /dev/null @@ -1,44 +0,0 @@ - -kernel32.dll!LoadLibraryExW -sni.dll!GetSniMaxComposedSpnLength -sni.dll!SNIAddProviderWrapper -sni.dll!SNICheckConnectionWrapper -sni.dll!SNICloseWrapper -sni.dll!SNIGetInfoWrapper -sni.dll!SNIGetLastError -sni.dll!SNIInitialize -sni.dll!SNIOpenSyncExWrapper -sni.dll!SNIOpenWrapper -sni.dll!SNIPacketAllocateWrapper -sni.dll!SNIPacketGetDataWrapper -sni.dll!SNIPacketRelease -sni.dll!SNIPacketResetWrapper -sni.dll!SNIPacketSetData -sni.dll!SNIQueryInfo -sni.dll!SNIReadAsyncWrapper -sni.dll!SNIReadSyncOverAsync -sni.dll!SNIRemoveProviderWrapper -sni.dll!SNISecGenClientContextWrapper -sni.dll!SNISecInitPackage -sni.dll!SNISetInfoWrapper -sni.dll!SNITerminate -sni.dll!SNIWaitForSSLHandshakeToCompleteWrapper -sni.dll!SNIWriteAsyncWrapper -sni.dll!SNIWriteSyncOverAsync -sni.dll!UnmanagedIsTokenRestricted -sspicli.dll!AcceptSecurityContext -sspicli.dll!AcquireCredentialsHandleW -sspicli.dll!ApplyControlToken -sspicli.dll!CompleteAuthToken -sspicli.dll!DecryptMessage -sspicli.dll!DeleteSecurityContext -sspicli.dll!EncryptMessage -sspicli.dll!EnumerateSecurityPackagesW -sspicli.dll!FreeContextBuffer -sspicli.dll!FreeCredentialsHandle -sspicli.dll!InitializeSecurityContextW -sspicli.dll!QueryContextAttributesW -sspicli.dll!QuerySecurityContextToken -sspicli.dll!SetContextAttributesW -sspicli.dll!SspiEncodeStringsAsAuthIdentity -sspicli.dll!SspiFreeAuthIdentity \ No newline at end of file diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj index a347780912..9b281b91c6 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj @@ -104,7 +104,9 @@ - + + Address + TDS.Servers From d8fad2f158ee5c5489e86327bca4c6ba06ac3e16 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 4 Mar 2024 14:10:38 +0100 Subject: [PATCH 13/25] fix bad merge --- tools/specs/Microsoft.Data.SqlClient.nuspec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec index a9ea7f00fc..7f1c37e83a 100644 --- a/tools/specs/Microsoft.Data.SqlClient.nuspec +++ b/tools/specs/Microsoft.Data.SqlClient.nuspec @@ -106,12 +106,14 @@ When using NuGet 3.x this package requires at least version 3.4. + + - + From bb3e2b1906eed209acc9bba058e01c2d29b5ea53 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 4 Mar 2024 14:15:12 +0100 Subject: [PATCH 14/25] remove whitespace --- tools/specs/Microsoft.Data.SqlClient.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec index 7f1c37e83a..afde5bf0df 100644 --- a/tools/specs/Microsoft.Data.SqlClient.nuspec +++ b/tools/specs/Microsoft.Data.SqlClient.nuspec @@ -113,7 +113,7 @@ When using NuGet 3.x this package requires at least version 3.4. - + From 1e6a0b830180abef62246d532a90decd5bd7e8dd Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 4 Mar 2024 15:11:43 +0100 Subject: [PATCH 15/25] Remove some strings --- src/Directory.Build.props | 4 +- .../src/Microsoft.Data.SqlClient.csproj | 6 +-- .../src/Resources/Strings.Designer.cs | 9 ---- .../src/Resources/Strings.de.resx | 8 +-- .../src/Resources/Strings.es.resx | 5 +- .../src/Resources/Strings.fr.resx | 5 +- .../src/Resources/Strings.it.resx | 5 +- .../src/Resources/Strings.ja.resx | 5 +- .../src/Resources/Strings.ko.resx | 5 +- .../src/Resources/Strings.pt-BR.resx | 5 +- .../src/Resources/Strings.resx | 5 +- .../src/Resources/Strings.ru.resx | 5 +- .../src/Resources/Strings.zh-Hans.resx | 5 +- .../src/Resources/Strings.zh-Hant.resx | 5 +- tools/specs/Microsoft.Data.SqlClient.nuspec | 53 +++++++++++-------- 15 files changed, 46 insertions(+), 84 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index cc502f3798..1fa393eccb 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -15,10 +15,8 @@ "Project" => Build and run tests with Microsoft.Data.SqlClient as Project Reference "Package" => Build and run tests with Microsoft.Data.SqlClient as Package Reference with configured "TestMicrosoftDataSqlClientVersion" in "Versions.props" file. - "NetStandard" => Build and run tests with Microsoft.Data.SqlClient as Project Reference via .NET Standard Library - "NetStandardPackage" => Build and run tests with Microsoft.Data.SqlClient as Package Reference via .NET Standard Library - ************** IMPORTANT NOTE BEFORE PROCEEDING WITH "PACKAGE" AND "NETSTANDARDPACKAGE" REFERENCE TYPES *************** + ************** IMPORTANT NOTE BEFORE PROCEEDING WITH "PACKAGE" REFERENCE TYPE *************** CREATE A NUGET PACKAGE WITH BELOW COMMAND AND ADD TO LOCAL FOLDER + UPDATE NUGET CONFIG FILE TO READ FROM THAT LOCATION > msbuild -p:configuration=Release --> diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj index bfaf0e96da..50d8b7d64d 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj @@ -762,9 +762,9 @@ - - - + + + diff --git a/src/Microsoft.Data.SqlClient/src/Resources/Strings.Designer.cs b/src/Microsoft.Data.SqlClient/src/Resources/Strings.Designer.cs index a99e5d0303..533ffa86ad 100644 --- a/src/Microsoft.Data.SqlClient/src/Resources/Strings.Designer.cs +++ b/src/Microsoft.Data.SqlClient/src/Resources/Strings.Designer.cs @@ -10503,15 +10503,6 @@ internal static string SQL_StreamWriteNotSupported { } } - /// - /// Looks up a localized string similar to Not supported in .Net Standard 2.0.. - /// - internal static string SQL_TDS8_NotSupported_Netstandard2_0 { - get { - return ResourceManager.GetString("SQL_TDS8_NotSupported_Netstandard2_0", resourceCulture); - } - } - /// /// Looks up a localized string similar to Processing of results from SQL Server failed because of an invalid multipart name. /// diff --git a/src/Microsoft.Data.SqlClient/src/Resources/Strings.de.resx b/src/Microsoft.Data.SqlClient/src/Resources/Strings.de.resx index ac803efe71..7862b1769c 100644 --- a/src/Microsoft.Data.SqlClient/src/Resources/Strings.de.resx +++ b/src/Microsoft.Data.SqlClient/src/Resources/Strings.de.resx @@ -4680,12 +4680,6 @@ Socket hat den erwarteten "{0}" nicht ausgelöst. Fehlercode: "{1}". - - Wird in .NET Standard 2.0 nicht unterstützt. - - - Der Server versucht, ein Feature zu verwenden, das auf dieser Plattform nicht unterstützt wird. - Das Schlüsselwort "{0}" wird auf dieser Plattform nicht unterstützt. @@ -4740,4 +4734,4 @@ Das Zertifikat ist während der Überprüfung des Zertifikats nicht verfügbar. - \ No newline at end of file + diff --git a/src/Microsoft.Data.SqlClient/src/Resources/Strings.es.resx b/src/Microsoft.Data.SqlClient/src/Resources/Strings.es.resx index 821f8f1aa5..028ceeba85 100644 --- a/src/Microsoft.Data.SqlClient/src/Resources/Strings.es.resx +++ b/src/Microsoft.Data.SqlClient/src/Resources/Strings.es.resx @@ -4680,9 +4680,6 @@ El socket no produjo el esperado '{0}' con el código de error '{1}'. - - No se admite en .NET Standard 2.0. - El servidor está intentando usar una característica que no se admite en esta plataforma. @@ -4740,4 +4737,4 @@ El certificado no está disponible al validar el certificado. - \ No newline at end of file + diff --git a/src/Microsoft.Data.SqlClient/src/Resources/Strings.fr.resx b/src/Microsoft.Data.SqlClient/src/Resources/Strings.fr.resx index d7e42c70c7..60c04699b7 100644 --- a/src/Microsoft.Data.SqlClient/src/Resources/Strings.fr.resx +++ b/src/Microsoft.Data.SqlClient/src/Resources/Strings.fr.resx @@ -4680,9 +4680,6 @@ Le socket n’a pas levé le '{0}' attendu avec le code d’erreur '{1}'. - - Non pris en charge dans .Net Standard 2.0. - Le serveur tente d’utiliser une fonctionnalité qui n’est pas prise en charge sur cette plateforme. @@ -4740,4 +4737,4 @@ Certificat non disponible lors de sa validation. - \ No newline at end of file + diff --git a/src/Microsoft.Data.SqlClient/src/Resources/Strings.it.resx b/src/Microsoft.Data.SqlClient/src/Resources/Strings.it.resx index add941c9ce..01e3a62844 100644 --- a/src/Microsoft.Data.SqlClient/src/Resources/Strings.it.resx +++ b/src/Microsoft.Data.SqlClient/src/Resources/Strings.it.resx @@ -4680,9 +4680,6 @@ Il socket non ha generato '{0}' previsto con codice errore '{1}'. - - Non supportato in .NET Standard 2.0. - Il server sta tentando di usare una funzionalità non supportata in questa piattaforma. @@ -4740,4 +4737,4 @@ Certificato non disponibile durante la convalida del certificato. - \ No newline at end of file + diff --git a/src/Microsoft.Data.SqlClient/src/Resources/Strings.ja.resx b/src/Microsoft.Data.SqlClient/src/Resources/Strings.ja.resx index 8b5b367a9f..bd05c52169 100644 --- a/src/Microsoft.Data.SqlClient/src/Resources/Strings.ja.resx +++ b/src/Microsoft.Data.SqlClient/src/Resources/Strings.ja.resx @@ -4680,9 +4680,6 @@ ソケットは予期された '{0}' をスローしませんでした。エラー コード '{1}'。 - - .Net Standard 2.0 ではサポートされていません。 - サーバーは、このプラットフォームでサポートされていない機能を使用しようとしています。 @@ -4740,4 +4737,4 @@ 証明書の検証中は証明書を使用できません。 - \ No newline at end of file + diff --git a/src/Microsoft.Data.SqlClient/src/Resources/Strings.ko.resx b/src/Microsoft.Data.SqlClient/src/Resources/Strings.ko.resx index d3d62df164..e2886df8ff 100644 --- a/src/Microsoft.Data.SqlClient/src/Resources/Strings.ko.resx +++ b/src/Microsoft.Data.SqlClient/src/Resources/Strings.ko.resx @@ -4680,9 +4680,6 @@ 소켓이 오류 코드 '{1}'과(와) 예상되는 '{0}'을(를) throw하지 않았습니다. - - .Net Standard 2.0에서는 지원되지 않습니다. - 서버가 이 플랫폼에서 지원되지 않는 기능을 사용하려고 합니다. @@ -4740,4 +4737,4 @@ 인증서의 유효성을 검사하는 동안에는 인증서를 사용할 수 없습니다. - \ No newline at end of file + diff --git a/src/Microsoft.Data.SqlClient/src/Resources/Strings.pt-BR.resx b/src/Microsoft.Data.SqlClient/src/Resources/Strings.pt-BR.resx index 3cb1ae77ec..3a7fcbb0f4 100644 --- a/src/Microsoft.Data.SqlClient/src/Resources/Strings.pt-BR.resx +++ b/src/Microsoft.Data.SqlClient/src/Resources/Strings.pt-BR.resx @@ -4680,9 +4680,6 @@ O soquete não lançou o esperado '{0}' com código de erro '{1}'. - - Sem suporte no .Net Standard 2.0. - O servidor está tentando usar um recurso que não é suportado nesta plataforma. @@ -4740,4 +4737,4 @@ Certificado não disponível durante a validação do certificado. - \ No newline at end of file + diff --git a/src/Microsoft.Data.SqlClient/src/Resources/Strings.resx b/src/Microsoft.Data.SqlClient/src/Resources/Strings.resx index 3712ece88f..3fb2e0a74a 100644 --- a/src/Microsoft.Data.SqlClient/src/Resources/Strings.resx +++ b/src/Microsoft.Data.SqlClient/src/Resources/Strings.resx @@ -4680,9 +4680,6 @@ Socket did not throw expected '{0}' with error code '{1}'. - - Not supported in .Net Standard 2.0. - The server is attempting to use a feature that is not supported on this platform. @@ -4740,4 +4737,4 @@ Certificate not available while validating the certificate. - \ No newline at end of file + diff --git a/src/Microsoft.Data.SqlClient/src/Resources/Strings.ru.resx b/src/Microsoft.Data.SqlClient/src/Resources/Strings.ru.resx index 24fb60a6e4..3051d03352 100644 --- a/src/Microsoft.Data.SqlClient/src/Resources/Strings.ru.resx +++ b/src/Microsoft.Data.SqlClient/src/Resources/Strings.ru.resx @@ -4680,9 +4680,6 @@ Сокет не вызвал ожидаемый "{0}" с кодом ошибки "{1}". - - Не поддерживается в .NET Standard 2.0. - Сервер пытается использовать функцию, которая не поддерживается этой платформой. @@ -4740,4 +4737,4 @@ Сертификат недоступен при проверке сертификата. - \ No newline at end of file + diff --git a/src/Microsoft.Data.SqlClient/src/Resources/Strings.zh-Hans.resx b/src/Microsoft.Data.SqlClient/src/Resources/Strings.zh-Hans.resx index e2d34132a8..e24601fb33 100644 --- a/src/Microsoft.Data.SqlClient/src/Resources/Strings.zh-Hans.resx +++ b/src/Microsoft.Data.SqlClient/src/Resources/Strings.zh-Hans.resx @@ -4680,9 +4680,6 @@ 套接字未引发预期的“{0}”,错误代码为“{1}”。 - - .Net Standard 2.0 不支持。 - 服务器正在尝试使用此平台不支持的功能。 @@ -4740,4 +4737,4 @@ 验证证书时证书不可用。 - \ No newline at end of file + diff --git a/src/Microsoft.Data.SqlClient/src/Resources/Strings.zh-Hant.resx b/src/Microsoft.Data.SqlClient/src/Resources/Strings.zh-Hant.resx index d345373858..3492f58356 100644 --- a/src/Microsoft.Data.SqlClient/src/Resources/Strings.zh-Hant.resx +++ b/src/Microsoft.Data.SqlClient/src/Resources/Strings.zh-Hant.resx @@ -4680,9 +4680,6 @@ 通訊端未擲出預期的 '{0}',錯誤碼為 '{1}'。 - - .NET Standard 2.0 中不支援。 - 伺服器正嘗試使用此平台上不支援的功能。 @@ -4740,4 +4737,4 @@ 驗證在進行憑證驗證時無法使用。 - \ No newline at end of file + diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec index afde5bf0df..aaf9339970 100644 --- a/tools/specs/Microsoft.Data.SqlClient.nuspec +++ b/tools/specs/Microsoft.Data.SqlClient.nuspec @@ -31,8 +31,8 @@ When using NuGet 3.x this package requires at least version 3.4. - - + + @@ -42,8 +42,8 @@ When using NuGet 3.x this package requires at least version 3.4. - - + + @@ -52,8 +52,8 @@ When using NuGet 3.x this package requires at least version 3.4. - - + + @@ -92,28 +92,37 @@ When using NuGet 3.x this package requires at least version 3.4. + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - + + + - + @@ -145,8 +154,8 @@ When using NuGet 3.x this package requires at least version 3.4. - - + + From c2c923f1a5d4ce6b6230dcd1ad954b8b35604413 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Tue, 5 Mar 2024 09:02:57 +0100 Subject: [PATCH 16/25] Update some build tools and guide --- BUILDGUIDE.md | 10 ++---- RunPackageReferenceTests.cmd | 68 ------------------------------------ 2 files changed, 2 insertions(+), 76 deletions(-) diff --git a/BUILDGUIDE.md b/BUILDGUIDE.md index 4434af3f1a..458fb682e4 100644 --- a/BUILDGUIDE.md +++ b/BUILDGUIDE.md @@ -233,17 +233,15 @@ Tests can be built and run with custom "Reference Type" property that enables di - "Project" => Build and run tests with Microsoft.Data.SqlClient as Project Reference - "Package" => Build and run tests with Microsoft.Data.SqlClient as Package Reference with configured "TestMicrosoftDataSqlClientVersion" in "Versions.props" file. -- "NetStandard" => Build and run tests with Microsoft.Data.SqlClient as Project Reference via .NET Standard Library -- "NetStandardPackage" => Build and run tests with Microsoft.Data.SqlClient as Package Reference via .NET Standard Library -> ************** IMPORTANT NOTE BEFORE PROCEEDING WITH "PACKAGE" AND "NETSTANDARDPACKAGE" REFERENCE TYPES *************** +> ************** IMPORTANT NOTE BEFORE PROCEEDING WITH "PACKAGE" REFERENCE TYPE *************** > CREATE A NUGET PACKAGE WITH BELOW COMMAND AND ADD TO LOCAL FOLDER + UPDATE NUGET CONFIG FILE TO READ FROM THAT LOCATION > > ```bash > msbuild -p:configuration=Release > ``` -A non-AnyCPU platform reference can only be used with package and NetStandardPackage reference types. Otherwise, the specified platform will be replaced with AnyCPU in the build process. +A non-AnyCPU platform reference can only be used with package reference type. Otherwise, the specified platform will be replaced with AnyCPU in the build process. ### Building Tests with Reference Type @@ -254,10 +252,6 @@ msbuild -t:BuildTestsNetCore -p:ReferenceType=Project # Default setting uses Project Reference. msbuild -t:BuildTestsNetCore -p:ReferenceType=Package - -msbuild -t:BuildTestsNetCore -p:ReferenceType=NetStandard - -msbuild -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage ``` For .NET Framework, below reference types are supported: diff --git a/RunPackageReferenceTests.cmd b/RunPackageReferenceTests.cmd index 037d5aa84c..28bc3a48d6 100644 --- a/RunPackageReferenceTests.cmd +++ b/RunPackageReferenceTests.cmd @@ -70,74 +70,6 @@ call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:Targ call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Platform="Win32" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" -p:TargetNetFxVersion=net48 --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net48-functional-Win32.xml call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Platform="Win32" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" -p:TargetNetFxVersion=net48 --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net48-manual-Win32.xml -:: REFERENCE TYPE "NETSTANDARDPACKAGE" - -:: .NET - REFERENCE TYPE "NETSTANDARDPACKAGE" - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage -p:TargetNetCoreVersion=net6.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="AnyCPU" -p:TargetNetCoreVersion=net6.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net6.0-functional-anycpu.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="AnyCPU" -p:TargetNetCoreVersion=net6.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net6.0-manual-anycpu.xml - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage -p:TargetNetCoreVersion=net8.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="AnyCPU" -p:TargetNetCoreVersion=net8.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net8.0-functional-anycpu.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="AnyCPU" -p:TargetNetCoreVersion=net8.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net8.0-manual-anycpu.xml - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage -p:Platform=x64 -p:TargetNetCoreVersion=net6.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="x64" -p:TargetNetCoreVersion=net6.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net6.0-functional-x64.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="x64" -p:TargetNetCoreVersion=net6.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net6.0-manual-x64.xml - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage -p:Platform=x64 -p:TargetNetCoreVersion=net8.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="x64" -p:TargetNetCoreVersion=net8.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net8.0-functional-x64.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="x64" -p:TargetNetCoreVersion=net8.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net8.0-manual-x64.xml - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage -p:Platform=Win32 -p:TargetNetCoreVersion=net6.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="Win32" -p:TargetNetCoreVersion=net6.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net6.0-functional-win32.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="Win32" -p:TargetNetCoreVersion=net6.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net6.0-manual-win32.xml - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage -p:Platform=Win32 -p:TargetNetCoreVersion=net8.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="Win32" -p:TargetNetCoreVersion=net8.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net8.0-functional-win32.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="Win32" -p:TargetNetCoreVersion=net8.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net8.0-manual-win32.xml - -:: .NET Framework - REFERENCE TYPE "NETSTANDARDPACKAGE" - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:ReferenceType=NetStandardPackage -p:TargetNetFxVersion=net462 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:Platform="AnyCPU" -p:TargetNetFxVersion=net462 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-functional-anycpu.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:Platform="AnyCPU" -p:TargetNetFxVersion=net462 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-manual-anycpu.xml - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:ReferenceType=NetStandardPackage -p:TargetNetFxVersion=net48 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:Platform="AnyCPU" -p:TargetNetFxVersion=net48 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net48-functional-anycpu.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:Platform="AnyCPU" -p:TargetNetFxVersion=net48 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net48-manual-anycpu.xml - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:ReferenceType=NetStandardPackage -p:Platform=x64 -p:TargetNetFxVersion=net462 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:Platform="x64" -p:TargetNetFxVersion=net462 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-functional-x64.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:Platform="x64" -p:TargetNetFxVersion=net462 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-manual-x64.xml - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:ReferenceType=NetStandardPackage -p:Platform=x64 -p:TargetNetFxVersion=net48 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:Platform="x64" -p:TargetNetFxVersion=net48 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net48-functional-x64.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:Platform="x64" -p:TargetNetFxVersion=net48 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net48-manual-x64.xml - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:ReferenceType=NetStandardPackage -p:Platform=Win32 -p:TargetNetFxVersion=net462 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:Platform="Win32" -p:TargetNetFxVersion=net462 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-functional-win32.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:Platform="Win32" -p:TargetNetFxVersion=net462 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-manual-win32.xml - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:ReferenceType=NetStandardPackage -p:Platform=Win32 -p:TargetNetFxVersion=net48 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:Platform="Win32" -p:TargetNetFxVersion=net48 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net48-functional-win32.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -p:Platform="Win32" -p:TargetNetFxVersion=net48 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net48-manual-win32.xml - -:: REFERENCE TYPE "NETSTANDARD" (We only build and test AnyCPU with Project Reference) -:: NUGET PACKAGE GENERATION IS NOT SUPPORTED FOR REFERNCE TYPE 'NETSTANDARD' -call :pauseOnError msbuild -p:Configuration="Release" -p:ReferenceType=NetStandard -p:GenerateNuget=false -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandard -p:TargetNetCoreVersion=net6.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="AnyCPU" -p:TargetNetCoreVersion=net6.0 -p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-net6.0-functional-anycpu.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="AnyCPU" -p:TargetNetCoreVersion=net6.0 -p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-net6.0-manual-anycpu.xml - -call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandard -p:TargetNetCoreVersion=net8.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="AnyCPU" -p:TargetNetCoreVersion=net8.0 -p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-net8.0-functional-anycpu.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -p:Platform="AnyCPU" -p:TargetNetCoreVersion=net8.0 -p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-net8.0-manual-anycpu.xml - -:: TESTING 'NETSTANDARD' REFERENCE TYPE WITH .NET FRAMEWORK 4.6.2+ AS TARGET FRAMEWORK IS INVALID CASE AS PROJECT REFERENCE DOES NOT LOAD SNI.DLL IN .NET FRAMEWORK RUNTIME. -:: CASE IS VERIFIED WITH RUNTIME.NATIVE.SYSTEM.DATA.SQLCLIENT.SNI AS WELL. TO TEST .NET FRAMEWORK TARGETS, USE 'NETSTANDARDPACKAGE' REFERENCE TYPE ONLY. - goto :eof :pauseOnError From be7604c6739f32129b1955604b9bf610bb12036f Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Tue, 9 Apr 2024 07:38:56 +0200 Subject: [PATCH 17/25] Resolve remaing issues --- .../src/Microsoft/Data/SqlClient/SNI/SNICommon.cs | 11 +++++------ .../src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs index 45400e67b3..9ccc98a779 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs @@ -342,12 +342,11 @@ internal static IPAddress[] GetDnsIpAddresses(string serverName, TimeoutTimer ti args0: serverName, args1: remainingTimeout); using CancellationTokenSource cts = new CancellationTokenSource(remainingTimeout); - // using this overload to support netstandard - //TODO Refactor? - Task task = Dns.GetHostAddressesAsync(serverName); - task.ConfigureAwait(false); - task.Wait(cts.Token); - return task.Result; + + return Dns.GetHostAddressesAsync(serverName, cts.Token) + .ConfigureAwait(false) + .GetAwaiter() + .GetResult(); } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs index 354eddfe90..ce3b9dd26b 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs @@ -526,8 +526,6 @@ internal static string GetLocalDBInstance(string dataSource, out bool error) string instanceName = null; ReadOnlySpan input = dataSource.AsSpan().TrimStart(); error = false; - // NetStandard 2.0 does not support passing a string to ReadOnlySpan - //TODO Refactor? int index = input.IndexOf(LocalDbHost.AsSpan().Trim(), StringComparison.InvariantCultureIgnoreCase); if (input.StartsWith(LocalDbHost_NP.AsSpan().Trim(), StringComparison.InvariantCultureIgnoreCase)) { From 38fe871e2143a8ef6045caa057a8516a58abcea6 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Wed, 10 Apr 2024 07:36:03 +0200 Subject: [PATCH 18/25] Update csproj --- .../src/Microsoft.Data.SqlClient.csproj | 36 ++----------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj index 50d8b7d64d..696c98eb14 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj @@ -2,7 +2,6 @@ Microsoft.Data.SqlClient net8.0;net6.0 - netstandard2.1 Microsoft.Data.SqlClient is not supported on this platform. $(OS) true @@ -10,7 +9,6 @@ false netcoreapp - netstandard Debug;Release; AnyCPU;x64;x86 $(ObjFolder)$(Configuration).$(Platform)\$(AssemblyName)\netcore\ @@ -535,25 +533,10 @@ Microsoft\Data\ProviderBase\DbReferenceCollection.cs - + - - - Microsoft\Data\SqlClient\EnclaveDelegate.NotSupported.cs - - - Microsoft\Data\SqlClient\SqlEnclaveAttestationParameters.NotSupported.cs - - - - - - - - - - + Microsoft\Data\SqlClient\AlwaysEncryptedEnclaveProviderUtils.cs @@ -951,7 +934,7 @@ - + Common\Interop\Unix\Interop.Libraries.cs @@ -1003,19 +986,6 @@ Microsoft.Data.SqlClient.SqlMetaData.xml - - - - - - - - - - - - - From b0552adba42d88b2dae2e89317ac3fc833efc7a2 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Wed, 10 Apr 2024 07:42:41 +0200 Subject: [PATCH 19/25] Remove NETSTANDARD constant --- .../tests/FunctionalTests/SqlBufferTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlBufferTests.cs b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlBufferTests.cs index 6aef4b60b2..21169fba96 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlBufferTests.cs +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlBufferTests.cs @@ -209,7 +209,7 @@ public object SqlValue public void SetToNullOfType(StorageType storageType) { -#if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER +#if NET6_0_OR_GREATER _setToNullOfTypeMethod .Invoke(_instance, BindingFlags.DoNotWrapExceptions, null, new object[] { (int)storageType }, null); #else @@ -219,7 +219,7 @@ public void SetToNullOfType(StorageType storageType) private T GetPropertyValue(PropertyInfo property) { -#if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER +#if NET6_0_OR_GREATER return (T)property.GetValue(_instance, BindingFlags.DoNotWrapExceptions, null, null, null); #else try @@ -235,7 +235,7 @@ private T GetPropertyValue(PropertyInfo property) private void SetPropertyValue(PropertyInfo property, object value) { -#if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER +#if NET6_0_OR_GREATER property.SetValue(_instance, value, BindingFlags.DoNotWrapExceptions, null, null, null); #else try From 2ad94aac3c83242f234d7d67b8d52b7a7b88d8b7 Mon Sep 17 00:00:00 2001 From: Davoud Date: Wed, 10 Apr 2024 13:02:01 -0700 Subject: [PATCH 20/25] Remove ref files in nuspec --- tools/specs/Microsoft.Data.SqlClient.nuspec | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec index aaf9339970..72e4695f99 100644 --- a/tools/specs/Microsoft.Data.SqlClient.nuspec +++ b/tools/specs/Microsoft.Data.SqlClient.nuspec @@ -92,15 +92,6 @@ When using NuGet 3.x this package requires at least version 3.4. - - - - - - - - - From 49d97e324970052e29f38934014b9f26d367f17a Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 22 Apr 2024 11:36:42 +0200 Subject: [PATCH 21/25] Update nuspec --- ....AlwaysEncrypted.AzureKeyVaultProvider.nuspec | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec b/tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec index b651ad91b8..c4dd609724 100644 --- a/tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec +++ b/tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec @@ -42,12 +42,6 @@ Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyStoreProvider.SqlColumnEncrypti - - - - - - @@ -85,15 +79,5 @@ Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyStoreProvider.SqlColumnEncrypti - - - - - - - - - - From 04afc1fbfb46ef2155da4db45db9f5f9d62066b4 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Mon, 22 Apr 2024 12:01:25 +0200 Subject: [PATCH 22/25] Update to latest main --- .../src/Microsoft.Data.SqlClient.csproj | 541 ++++++++---------- ...waysEncryptedKeyConverter.CrossPlatform.cs | 4 - .../SqlClient/SNI/SNIStreams.ValueTask.cs | 4 - .../SNI/SslOverTdsStream.NetCoreApp.cs | 4 - ...uthenticationProviderManager.NetCoreApp.cs | 4 - .../SqlClientEventSource.NetCoreApp.cs | 4 - ...umnEncryptionEnclaveProvider.NetCoreApp.cs | 4 - .../SqlDelegatedTransaction.NetCoreApp.cs | 4 - .../Data/SqlClient/TdsParser.NetCoreApp.cs | 4 - .../AlwaysEncryptedEnclaveProviderUtils.cs | 4 - .../AzureAttestationBasedEnclaveProvider.cs | 4 - .../Data/SqlClient/EnclaveDelegate.Crypto.cs | 4 - .../Data/SqlClient/EnclaveProviderBase.cs | 4 - .../Data/SqlClient/EnclaveSessionCache.cs | 4 - .../NoneAttestationEnclaveProvider.cs | 4 - .../SqlEnclaveAttestationParameters.Crypto.cs | 4 - .../VirtualSecureModeEnclaveProvider.cs | 4 - .../VirtualSecureModeEnclaveProviderBase.cs | 4 - 18 files changed, 253 insertions(+), 356 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj index 696c98eb14..0a0f573333 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj @@ -28,6 +28,49 @@ + + Common\CoreLib\System\Threading\Tasks\TaskToApm.cs + + + Common\Microsoft\Data\ProviderBase\DbConnectionClosed.cs + + + Common\Microsoft\Data\ProviderBase\DbConnectionFactory.cs + + + Common\Microsoft\Data\ProviderBase\DbConnectionInternal.cs + + + Common\System\Net\ContextFlagsPal.cs + + + Common\System\Net\DebugCriticalHandleMinusOneIsInvalid.cs + + + Common\System\Net\DebugSafeHandle.cs + + + Common\System\Net\InternalException.cs + + + Common\System\Net\Logging\DebugThreadTracking.cs + + + Common\System\Net\Logging\NetEventSource.Common.cs + + + Common\System\Net\NegotiationInfoClass.cs + + + Common\System\Net\Security\SecurityBuffer.cs + + + Common\System\Net\Security\SecurityBufferType.cs + + + Common\System\Net\SecurityStatusPal.cs + + Microsoft\Data\Common\ActivityCorrelator.cs @@ -79,6 +122,9 @@ Microsoft\Data\ProviderBase\DbMetaDataFactory.cs + + Common\Microsoft\Data\ProviderBase\DbReferenceCollection.cs + Microsoft\Data\ProviderBase\FieldNameLookup.cs @@ -103,12 +149,18 @@ Microsoft\Data\SqlClient\ActiveDirectoryAuthenticationTimeoutRetryHelper.cs + + Microsoft\Data\SqlClient\AlwaysEncryptedEnclaveProviderUtils.cs + Microsoft\Data\SqlClient\ApplicationIntent.cs Microsoft\Data\SqlClient\AssemblyRef.cs + + Microsoft\Data\SqlClient\AzureAttestationBasedEnclaveProvider.cs + Microsoft\Data\SqlClient\ColumnEncryptionKeyInfo.cs @@ -121,12 +173,24 @@ Microsoft\Data\SqlClient\EnclaveDelegate.cs + + Microsoft\Data\SqlClient\EnclaveDelegate.Crypto.cs + Microsoft\Data\SqlClient\EnclavePackage.cs + + Microsoft\Data\SqlClient\EnclaveProviderBase.cs + + + Microsoft\Data\SqlClient\EnclaveSessionCache.cs + Microsoft\Data\SqlClient\LocalAppContextSwitches.cs + + Microsoft\Data\SqlClient\NoneAttestationEnclaveProvider.cs + Microsoft\Data\SqlClient\OnChangedEventHandler.cs @@ -175,9 +239,6 @@ Microsoft\Data\SqlClient\RowsCopiedEventHandler.cs - - Microsoft\Data\SqlClient\SqlSequentialTextReader.cs - Microsoft\Data\SqlClient\Server\ExtendedClrTypeCode.cs @@ -244,8 +305,8 @@ Microsoft\Data\SqlClient\Server\SqlRecordBuffer.cs - - Microsoft\Data\SqlClient\SqlTransaction.Common.cs + + Microsoft\Data\SqlClient\Server\SqlSer.cs Microsoft\Data\SqlClient\Server\ValueUtilsSmi.cs @@ -271,9 +332,6 @@ Microsoft\Data\SqlClient\SqlAuthenticationProvider.cs - - Microsoft\Data\SqlClient\SqlBuffer.cs - Microsoft\Data\SqlClient\SqlAuthenticationToken.cs @@ -283,9 +341,15 @@ Microsoft\Data\SqlClient\SqlBatchCommand.cs + + Microsoft\Data\SqlClient\SqlBatchCommand.Net8OrGreater.cs + Microsoft\Data\SqlClient\SqlBatchCommandCollection.cs + + Microsoft\Data\SqlClient\SqlBuffer.cs + Microsoft\Data\SqlClient\SqlBulkCopyColumnMapping.cs @@ -331,12 +395,12 @@ Microsoft\Data\SqlClient\SqlCollation.cs - - Microsoft\Data\SqlClient\SqlColumnEncryptionKeyStoreProvider.cs - Microsoft\Data\SqlClient\SqlCommandBuilder.cs + + Microsoft\Data\SqlClient\SqlColumnEncryptionKeyStoreProvider.cs + Microsoft\Data\SqlClient\SqlCommandSet.cs @@ -382,6 +446,12 @@ Microsoft\Data\SqlClient\SqlDependencyUtils.AppDomain.cs + + Microsoft\Data\SqlClient\SqlDependencyUtils.AssemblyLoadContext.cs + + + Microsoft\Data\SqlClient\SqlEnclaveAttestationParameters.Crypto.cs + Microsoft\Data\SqlClient\SqlEnclaveSession.cs @@ -463,12 +533,15 @@ Microsoft\Data\SqlClient\SqlSequentialStream.cs - - Microsoft\Data\SqlClient\Server\SqlSer.cs + + Microsoft\Data\SqlClient\SqlSequentialTextReader.cs Microsoft\Data\SqlClient\SqlStatistics.cs + + Microsoft\Data\SqlClient\SqlStream.cs + Microsoft\Data\SqlClient\SqlSymmetricKeyCache.cs @@ -478,12 +551,27 @@ Microsoft\Data\SqlClient\SqlUtil.cs + + Microsoft\Data\SqlClient\SqlTransaction.Common.cs + + + Microsoft\Data\SqlClient\SSPI\ManagedSSPIContextProvider.cs + + + Microsoft\Data\SqlClient\SSPI\NegotiateSSPIContextProvider.cs + + + Microsoft\Data\SqlClient\SSPI\SSPIContextProvider.cs + Microsoft\Data\SqlClient\TdsEnums.cs Microsoft\Data\SqlClient\TdsParameterSetter.cs + + Microsoft\Data\SqlClient\TdsParser.cs + Microsoft\Data\SqlClient\TdsParserStateObject.cs @@ -499,16 +587,19 @@ Microsoft\Data\SqlClient\TdsValueSetter.cs + + Microsoft\Data\SqlClient\VirtualSecureModeEnclaveProvider.cs + + + Microsoft\Data\SqlClient\VirtualSecureModeEnclaveProviderBase.cs + Microsoft\Data\SQLTypes\SQLResource.cs Microsoft\Data\SqlTypes\SqlTypeWorkarounds.cs - - Microsoft\Data\SqlClient\SqlStream.cs - - + Resources\ResCategoryAttribute.cs @@ -517,117 +608,23 @@ Common\System\Diagnostics\CodeAnalysis.cs - - Microsoft\Data\SqlClient\SSPI\ManagedSSPIContextProvider.cs - - - Microsoft\Data\SqlClient\SSPI\NegotiateSSPIContextProvider.cs - - - Microsoft\Data\SqlClient\SSPI\SSPIContextProvider.cs - - - Microsoft\Data\SqlClient\TdsParser.cs - - - Microsoft\Data\ProviderBase\DbReferenceCollection.cs - - - - - - - - Microsoft\Data\SqlClient\AlwaysEncryptedEnclaveProviderUtils.cs - - - Microsoft\Data\SqlClient\AzureAttestationBasedEnclaveProvider.cs - - - Microsoft\Data\SqlClient\EnclaveDelegate.Crypto.cs - - - Microsoft\Data\SqlClient\EnclaveProviderBase.cs - - - Microsoft\Data\SqlClient\EnclaveSessionCache.cs - - - Microsoft\Data\SqlClient\SqlEnclaveAttestationParameters.Crypto.cs - - - Microsoft\Data\SqlClient\VirtualSecureModeEnclaveProvider.cs - - - Microsoft\Data\SqlClient\NoneAttestationEnclaveProvider.cs - - - Microsoft\Data\SqlClient\VirtualSecureModeEnclaveProviderBase.cs - - - - - - - - - - - - - Microsoft\Data\SqlClient\SqlDependencyUtils.AssemblyLoadContext.cs - - - - - - - Resources\StringsHelper.cs - - - Resources\Strings.Designer.cs - True - True - Strings.resx - - - Resources\Strings.resx - Microsoft.Data.SqlClient.Resources.Strings.resources - ResXFileCodeGenerator - Strings.Designer.cs - System - - - Resources\%(RecursiveDir)%(Filename)%(Extension) - - - - - Common\CoreLib\System\Threading\Tasks\TaskToApm.cs - - - Common\Microsoft\Data\ProviderBase\DbConnectionClosed.cs - - - Common\Microsoft\Data\ProviderBase\DbConnectionFactory.cs - - - Common\Microsoft\Data\ProviderBase\DbConnectionInternal.cs - - + + + + @@ -637,16 +634,23 @@ + - + + + + + + + @@ -654,52 +658,22 @@ + + - - - + + - - - Microsoft\Data\Common\AdapterUtil.Windows.cs - - - Microsoft\Data\Sql\SqlDataSourceEnumeratorNativeHelper.cs - - - Microsoft\Data\Sql\SqlDataSourceEnumerator.Windows.cs - - - - - - Microsoft\Data\SqlClient\TdsParserSafeHandles.Windows.cs - - - - - - Microsoft\Data\Common\AdapterUtil.Unix.cs - - - - - - - - - - Common\CoreLib\Interop\Windows\kernel32\Interop.FileTypes.cs @@ -707,15 +681,30 @@ Common\CoreLib\Interop\Windows\kernel32\Interop.GetFileType_SafeHandle.cs + + Common\CoreLib\Interop\Windows\Kernel32\Interop.CloseHandle.cs + Common\CoreLib\Interop\Windows\kernel32\Interop.SetThreadErrorMode.cs + + Common\CoreLib\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs + Common\CoreLib\System\IO\PathInternal.Windows.cs + + Common\Interop\Windows\Crypt32\Interop.certificates.cs + + + Common\Interop\Windows\Crypt32\Interop.certificates_types.cs + Common\Interop\Windows\Interop.Errors.cs + + Common\Interop\Windows\Interop.Libraries.cs + Common\Interop\Windows\Interop.UNICODE_STRING.cs @@ -725,6 +714,12 @@ Common\Interop\Windows\Kernel32\Interop.DeviceIoControl.cs + + Common\Interop\Windows\kernel32\Interop.FreeLibrary.cs + + + Common\Interop\Windows\kernel32\Interop.GetProcAddress.cs + Common\Interop\Windows\Kernel32\Interop.IoControlCodeAccess.cs @@ -743,89 +738,6 @@ Common\Interop\Windows\NtDll\Interop.RtlNtStatusToDosError.cs - - - - - - - - - - - - - - - - - - - - - - Common\Interop\Windows\kernel32\Interop.LoadLibraryEx.cs - - - Microsoft\Data\SqlClient\SSPI\NativeSSPIContextProvider.cs - - - - - - - - - - - Common\CoreLib\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs - - - Common\Interop\Windows\kernel32\Interop.FreeLibrary.cs - - - Common\Interop\Windows\kernel32\Interop.GetProcAddress.cs - - - - - - - Common\Interop\Windows\Interop.Libraries.cs - - - - - - Common\System\Net\InternalException.cs - - - Common\System\Net\Logging\NetEventSource.Common.cs - - - - - - - - - - - - - - - - - - Common\CoreLib\Interop\Windows\Kernel32\Interop.CloseHandle.cs - - - Common\Interop\Windows\Crypt32\Interop.certificates.cs - - - Common\Interop\Windows\Crypt32\Interop.certificates_types.cs - Common\Interop\Windows\SChannel\Interop.SecPkgContext_ApplicationProtocol.cs @@ -835,30 +747,6 @@ Common\Interop\Windows\SChannel\SecPkgContext_ConnectionInfo.cs - - Common\System\Collections\Generic\BidirectionalDictionary.cs - - - Common\System\Net\ContextFlagsAdapterPal.Windows.cs - - - Common\System\Net\DebugCriticalHandleZeroOrMinusOneIsInvalid.cs - - - Common\System\Net\Security\SecurityContextTokenHandle.cs - - - Common\System\Net\SecurityStatusAdapterPal.Windows.cs - - - Common\System\Net\Security\NegotiateStreamPal.Windows.cs - - - Common\System\Net\Security\NetEventSource.Security.cs - - - Common\System\Net\Security\NetEventSource.Security.Windows.cs - Common\Interop\Windows\sspicli\GlobalSSPI.cs @@ -904,37 +792,56 @@ Common\Interop\Windows\sspicli\SSPIWrapper.cs - - - - - Common\System\Net\ContextFlagsPal.cs + + Common\System\Collections\Generic\BidirectionalDictionary.cs - - Common\System\Net\DebugCriticalHandleMinusOneIsInvalid.cs + + Common\System\Net\ContextFlagsAdapterPal.Windows.cs - - Common\System\Net\DebugSafeHandle.cs + + Common\System\Net\DebugCriticalHandleZeroOrMinusOneIsInvalid.cs - - Common\System\Net\Logging\DebugThreadTracking.cs + + Common\System\Net\Security\NegotiateStreamPal.Windows.cs - - Common\System\Net\NegotiationInfoClass.cs + + Common\System\Net\Security\NetEventSource.Security.cs - - Common\System\Net\Security\SecurityBuffer.cs + + Common\System\Net\Security\NetEventSource.Security.Windows.cs - - Common\System\Net\Security\SecurityBufferType.cs + + Common\System\Net\Security\SecurityContextTokenHandle.cs - - Common\System\Net\SecurityStatusPal.cs + + Common\System\Net\SecurityStatusAdapterPal.Windows.cs - + + + Microsoft\Data\Common\AdapterUtil.Windows.cs + + + Microsoft\Data\Sql\SqlDataSourceEnumeratorNativeHelper.cs + + + Microsoft\Data\Sql\SqlDataSourceEnumerator.Windows.cs + + + Microsoft\Data\SqlClient\TdsParserSafeHandles.Windows.cs + + + + + + + + + + - - + + + Common\Interop\Unix\Interop.Libraries.cs @@ -968,24 +875,82 @@ Common\System\Net\Security\NegotiateStreamPal.Unix.cs + + + Microsoft\Data\Common\AdapterUtil.Unix.cs + + + + + + + + + + + + + + + - - + + + + + + + + - - - Microsoft\Data\SqlClient\SqlBatchCommand.Net8OrGreater.cs + + + + + Common\Interop\Windows\kernel32\Interop.LoadLibraryEx.cs + + Microsoft\Data\SqlClient\SSPI\NativeSSPIContextProvider.cs + + + + + + + - - - - + + + + Resources\StringsHelper.cs + + + Resources\Strings.Designer.cs + True + True + Strings.resx + + + Resources\Strings.resx + Microsoft.Data.SqlClient.Resources.Strings.resources + ResXFileCodeGenerator + Strings.Designer.cs + System + + + Resources\%(RecursiveDir)%(Filename)%(Extension) + Microsoft.Data.SqlClient.SqlMetaData.xml + + + + + + diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/AlwaysEncryptedKeyConverter.CrossPlatform.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/AlwaysEncryptedKeyConverter.CrossPlatform.cs index 81b90debeb..8b3def875c 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/AlwaysEncryptedKeyConverter.CrossPlatform.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/AlwaysEncryptedKeyConverter.CrossPlatform.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Diagnostics; using System.Security.Cryptography; @@ -135,5 +133,3 @@ internal static RSA GetRSAFromCertificate(X509Certificate2 certificate) } } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIStreams.ValueTask.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIStreams.ValueTask.cs index 03b071eac2..f5f38f0efe 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIStreams.ValueTask.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIStreams.ValueTask.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System.Threading; using System.Threading.Tasks; using System; @@ -109,5 +107,3 @@ public override async ValueTask WriteAsync(ReadOnlyMemory buffer, Cancella } } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SslOverTdsStream.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SslOverTdsStream.NetCoreApp.cs index 655fc91d7c..be8d1a0160 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SslOverTdsStream.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SslOverTdsStream.NetCoreApp.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Buffers; using System.Threading; @@ -295,5 +293,3 @@ public override async ValueTask WriteAsync(ReadOnlyMemory buffer, Cancella } } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.NetCoreApp.cs index 9170614927..dd57c60da8 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.NetCoreApp.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -197,5 +195,3 @@ internal class SqlClientAuthenticationProviderConfigurationSection : SqlAuthenti } } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlClientEventSource.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlClientEventSource.NetCoreApp.cs index 6dc531f766..c0312ca219 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlClientEventSource.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlClientEventSource.NetCoreApp.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Diagnostics.Tracing; using System.Threading; @@ -396,5 +394,3 @@ internal override void ReclaimedConnectionRequest() } } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionEnclaveProvider.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionEnclaveProvider.NetCoreApp.cs index da5a516004..fd81db557d 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionEnclaveProvider.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionEnclaveProvider.NetCoreApp.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System.Security.Cryptography; namespace Microsoft.Data.SqlClient @@ -25,5 +23,3 @@ internal abstract void CreateEnclaveSession(byte[] enclaveAttestationInfo, ECDif out SqlEnclaveSession sqlEnclaveSession, out long counter); } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.NetCoreApp.cs index ea27ceabe0..561f9bd6fb 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.NetCoreApp.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Transactions; @@ -16,5 +14,3 @@ internal sealed partial class SqlDelegatedTransaction : IPromotableSinglePhaseNo private Guid GetGlobalTxnIdentifierFromToken() => new Guid(new ReadOnlySpan(_connection.PromotedDTCToken, _globalTransactionsTokenVersionSizeInBytes, 16)); } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.NetCoreApp.cs index 2c7554a0cb..95dd0d9731 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.NetCoreApp.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.NetCoreApp.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Diagnostics; using System.Buffers.Binary; @@ -25,5 +23,3 @@ internal static Guid ConstructGuid(ReadOnlySpan bytes) } } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AlwaysEncryptedEnclaveProviderUtils.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AlwaysEncryptedEnclaveProviderUtils.cs index 890af0206f..ff84ab3310 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AlwaysEncryptedEnclaveProviderUtils.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AlwaysEncryptedEnclaveProviderUtils.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; namespace Microsoft.Data.SqlClient @@ -51,5 +49,3 @@ internal enum EnclaveType Sgx = 2 } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AzureAttestationBasedEnclaveProvider.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AzureAttestationBasedEnclaveProvider.cs index 70f6bc5f91..7b1b2bf2e4 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AzureAttestationBasedEnclaveProvider.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AzureAttestationBasedEnclaveProvider.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Collections.Generic; using System.Diagnostics; @@ -542,5 +540,3 @@ private byte[] GetSharedSecret(EnclavePublicKey enclavePublicKey, byte[] nonce, #endregion } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveDelegate.Crypto.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveDelegate.Crypto.cs index fc87127b04..db1bdea90f 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveDelegate.Crypto.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveDelegate.Crypto.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -213,5 +211,3 @@ internal byte[] GetSerializedAttestationParameters(SqlEnclaveAttestationParamete } } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveProviderBase.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveProviderBase.cs index 1a2bcaeb03..b8a52b9e4b 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveProviderBase.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveProviderBase.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Runtime.Caching; using System.Security.Cryptography; @@ -215,5 +213,3 @@ protected SqlEnclaveSession AddEnclaveSessionToCache(EnclaveSessionParameters en } #endregion } - -#endif diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveSessionCache.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveSessionCache.cs index d60c3ad5ba..2cc34eeeb5 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveSessionCache.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/EnclaveSessionCache.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Runtime.Caching; using System.Threading; @@ -74,5 +72,3 @@ private string GenerateCacheKey(EnclaveSessionParameters enclaveSessionParameter } } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/NoneAttestationEnclaveProvider.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/NoneAttestationEnclaveProvider.cs index 9ef8a77d19..fabd69c976 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/NoneAttestationEnclaveProvider.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/NoneAttestationEnclaveProvider.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Diagnostics; using System.Security.Cryptography; @@ -106,5 +104,3 @@ internal override void InvalidateEnclaveSession(EnclaveSessionParameters enclave } } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlEnclaveAttestationParameters.Crypto.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlEnclaveAttestationParameters.Crypto.cs index 2abb408d41..c2e9739237 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlEnclaveAttestationParameters.Crypto.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlEnclaveAttestationParameters.Crypto.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Security.Cryptography; @@ -52,5 +50,3 @@ internal byte[] GetInput() } } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProvider.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProvider.cs index 7ebad456f5..fd180d12d6 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProvider.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProvider.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Collections.Generic; using System.Diagnostics; @@ -470,5 +468,3 @@ public static byte[] TakeBytesAndAdvance(byte[] input, ref int offset, int count } } } - -#endif diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProviderBase.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProviderBase.cs index c60dd01c72..cfbe531e82 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProviderBase.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/VirtualSecureModeEnclaveProviderBase.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if !NETSTANDARD2_0 - using System; using System.Runtime.Caching; using System.Security.Cryptography; @@ -421,5 +419,3 @@ private byte[] GetSharedSecret(EnclavePublicKey enclavePublicKey, EnclaveDiffieH #endregion } } - -#endif From bf9a6f9955bc472a62a7012a05cd2968a755b066 Mon Sep 17 00:00:00 2001 From: Davoud Date: Mon, 22 Apr 2024 12:52:29 -0700 Subject: [PATCH 23/25] Remove a stale dependency and comments --- RunPackageReferenceTests.cmd | 4 ++-- tools/props/Versions.props | 2 +- tools/specs/Microsoft.Data.SqlClient.nuspec | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/RunPackageReferenceTests.cmd b/RunPackageReferenceTests.cmd index 28bc3a48d6..fa503f905e 100644 --- a/RunPackageReferenceTests.cmd +++ b/RunPackageReferenceTests.cmd @@ -1,10 +1,10 @@ @echo off -:: .NET CORE + .NET STANDARD LIBRARY TEST CASES +:: .NET CORE TEST CASES echo Building .NET Core Tests call :pauseOnError msbuild -t:Clean -:: ************** IMPORTANT NOTE BEFORE PROCEEDING WITH "PACKAGE" AND "NETSTANDARDPACKAGE" REFERENCE TYPES *************** +:: ************** IMPORTANT NOTE BEFORE PROCEEDING WITH "PACKAGE" REFERENCE TYPE *************** :: THESE ARE NOT STAND ALONE TEST COMMANDS AND NEED A DEVELOPER'S SPECIAL ATTENTION TO WORK. ATTEMPTING TO RUN THE ENTIRE SET OF COMMANDS AS-IS IS LIKELY TO FAIL! :: CREATE A NUGET PACKAGE WITH BELOW COMMAND AND ADD TO LOCAL FOLDER + UPDATE NUGET CONFIG FILE TO READ FROM THAT LOCATION diff --git a/tools/props/Versions.props b/tools/props/Versions.props index 8877dc2078..0da24012c4 100644 --- a/tools/props/Versions.props +++ b/tools/props/Versions.props @@ -37,7 +37,6 @@ - 5.0.0 5.2.0 6.0.1 1.0.0 @@ -73,6 +72,7 @@ 0.13.2 6.0.0 6.0.1 + 5.0.0 $(NugetPackageVersion) diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec index 72e4695f99..a257e8a414 100644 --- a/tools/specs/Microsoft.Data.SqlClient.nuspec +++ b/tools/specs/Microsoft.Data.SqlClient.nuspec @@ -34,7 +34,6 @@ When using NuGet 3.x this package requires at least version 3.4. - From 14660ab120775bf5f8d059c319e9ef264187cc2e Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Wed, 24 Apr 2024 08:24:39 +0200 Subject: [PATCH 24/25] Respond to PR review --- .../tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj index 9b281b91c6..b5ac559337 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj @@ -130,7 +130,6 @@ - From a5c75f59abe9054603c5e84c80f15daa5aba4799 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Tue, 30 Apr 2024 07:27:51 +0200 Subject: [PATCH 25/25] Clean nuspecs --- tools/specs/Microsoft.Data.SqlClient.nuspec | 100 +----------------- ...waysEncrypted.AzureKeyVaultProvider.nuspec | 19 +--- 2 files changed, 3 insertions(+), 116 deletions(-) diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec index ca4d10abf7..b1666d4459 100644 --- a/tools/specs/Microsoft.Data.SqlClient.nuspec +++ b/tools/specs/Microsoft.Data.SqlClient.nuspec @@ -58,41 +58,6 @@ When using NuGet 3.x this package requires at least version 3.4. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -111,14 +76,6 @@ When using NuGet 3.x this package requires at least version 3.4. - - - - - - - - @@ -135,13 +92,6 @@ When using NuGet 3.x this package requires at least version 3.4. - - - - - - - @@ -164,7 +114,7 @@ When using NuGet 3.x this package requires at least version 3.4. - + @@ -175,7 +125,7 @@ When using NuGet 3.x this package requires at least version 3.4. - + @@ -194,41 +144,6 @@ When using NuGet 3.x this package requires at least version 3.4. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -244,16 +159,5 @@ When using NuGet 3.x this package requires at least version 3.4. - - - - - - - - - - - diff --git a/tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec b/tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec index 33be2b3409..5c89d24276 100644 --- a/tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec +++ b/tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec @@ -42,12 +42,6 @@ Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyStoreProvider.SqlColumnEncrypti - - - - - - @@ -84,16 +78,5 @@ Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyStoreProvider.SqlColumnEncrypti - - - - - - - - - - - - +