Skip to content

Commit cc6ea21

Browse files
authored
Streamline conditional compilation symbols (#2486)
1 parent 9a71c94 commit cc6ea21

File tree

48 files changed

+75
-79
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+75
-79
lines changed

src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public static partial class SqlClientMetaDataCollectionNames
478478
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlClientMetaDataCollectionNames.xml' path='docs/members[@name="SqlClientMetaDataCollectionNames"]/StructuredTypeMembers/*' />
479479
public static readonly string StructuredTypeMembers;
480480
}
481-
#if NETCOREAPP
481+
#if NET6_0_OR_GREATER
482482
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnectionAttestationProtocol.xml' path='docs/members[@name="SqlConnectionAttestationProtocol"]/SqlConnectionAttestationProtocol/*' />
483483
public enum SqlConnectionAttestationProtocol
484484
{
@@ -1017,7 +1017,7 @@ public SqlConnectionStringBuilder(string connectionString) { }
10171017
[System.ComponentModel.DisplayNameAttribute("Data Source")]
10181018
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
10191019
public string DataSource { get { throw null; } set { } }
1020-
#if NETCOREAPP
1020+
#if NET6_0_OR_GREATER
10211021
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml' path='docs/members[@name="SqlConnectionStringBuilder"]/AttestationProtocol/*' />
10221022
[System.ComponentModel.DisplayNameAttribute("Attestation Protocol")]
10231023
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
@@ -1444,7 +1444,7 @@ internal SqlException() { }
14441444
public byte State { get { throw null; } }
14451445

14461446
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlException.xml' path='docs/members[@name="SqlException"]/GetObjectData/*'/>
1447-
#if !NET6_0_OR_GREATER
1447+
#if NETFRAMEWORK
14481448
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
14491449
#endif
14501450
#if NET8_0_OR_GREATER

src/Microsoft.Data.SqlClient/netcore/src/Common/src/Interop/Windows/Interop.Libraries.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal static partial class Libraries
99
internal const string Crypt32 = "crypt32.dll";
1010
internal const string Kernel32 = "kernel32.dll";
1111
internal const string NtDll = "ntdll.dll";
12-
#if !NET7_0_OR_GREATER
12+
#if !NET8_0_OR_GREATER
1313
internal const string SspiCli = "sspicli.dll";
1414
#endif
1515
}

src/Microsoft.Data.SqlClient/netcore/src/Common/src/System/Net/Logging/NetEventSource.Common.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
using System.Diagnostics.Tracing;
1414
using System.Runtime.CompilerServices;
1515
using System.Runtime.InteropServices;
16-
#if net462
16+
#if NETFRAMEWORK
1717
using System.Security;
1818
#endif
1919

@@ -45,7 +45,7 @@ namespace System.Net
4545
// method that takes an object and optionally provides a string representation of it, in case a particular library wants to customize further.
4646

4747
/// <summary>Provides logging facilities for System.Net libraries.</summary>
48-
#if net462
48+
#if NETFRAMEWORK
4949
[SecuritySafeCritical]
5050
#endif
5151
internal sealed partial class NetEventSource : EventSource

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.NetCoreApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if NETCOREAPP
5+
#if NET6_0_OR_GREATER
66

77
using System.Diagnostics;
88
using Microsoft.Data.Common;

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ private DbConnectionInternal CreateObject(DbConnection owningObject, DbConnectio
776776
throw;
777777
}
778778

779-
#if NETCOREAPP
779+
#if NET6_0_OR_GREATER
780780
if (!IsBlockingPeriodEnabled())
781781
{
782782
throw;

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ internal static bool ValidateSslServerCertificate(string targetServerName, X509C
190190

191191
if (policyErrors.HasFlag(SslPolicyErrors.RemoteCertificateNameMismatch))
192192
{
193-
#if NET7_0_OR_GREATER
193+
#if NET8_0_OR_GREATER
194194
X509Certificate2 cert2 = cert as X509Certificate2;
195195
if (!cert2.MatchesHostname(targetServerName))
196196
{
@@ -297,7 +297,7 @@ internal static bool ValidateSslServerCertificate(X509Certificate clientCert, X5
297297

298298
if (policyErrors.HasFlag(SslPolicyErrors.RemoteCertificateNameMismatch))
299299
{
300-
#if NET7_0_OR_GREATER
300+
#if NET8_0_OR_GREATER
301301
X509Certificate2 s_cert = serverCert as X509Certificate2;
302302
X509Certificate2 c_cert = clientCert as X509Certificate2;
303303

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal class SNIProxy
2626
private static readonly SNIProxy s_singleton = new SNIProxy();
2727

2828
internal static SNIProxy Instance => s_singleton;
29-
#if !NET7_0_OR_GREATER
29+
#if !NET8_0_OR_GREATER
3030
/// <summary>
3131
/// Generate SSPI context
3232
/// </summary>

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ public override void KillConnection()
10081008

10091009
internal static void SetKeepAliveValues(ref Socket socket)
10101010
{
1011-
#if NETCOREAPP
1011+
#if NET6_0_OR_GREATER
10121012
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
10131013
socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveInterval, 1);
10141014
socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveTime, 30);

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3994,7 +3994,7 @@ private SqlDataReader GetParameterEncryptionDataReader(out Task returnTask, Task
39943994
SqlCommand command = (SqlCommand)state;
39953995
bool processFinallyBlockAsync = true;
39963996
bool decrementAsyncCountInFinallyBlockAsync = true;
3997-
#if !NET6_0_OR_GREATER
3997+
#if NETFRAMEWORK
39983998
RuntimeHelpers.PrepareConstrainedRegions();
39993999
#endif
40004000
try
@@ -4068,7 +4068,7 @@ private SqlDataReader GetParameterEncryptionDataReaderAsync(out Task returnTask,
40684068
bool processFinallyBlockAsync = true;
40694069
bool decrementAsyncCountInFinallyBlockAsync = true;
40704070

4071-
#if !NET6_0_OR_GREATER
4071+
#if NETFRAMEWORK
40724072
RuntimeHelpers.PrepareConstrainedRegions();
40734073
#endif
40744074
try

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionFactory.AssemblyLoadContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if NETCOREAPP
5+
#if NET6_0_OR_GREATER
66

77
using System;
88
using System.Reflection;

0 commit comments

Comments
 (0)