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 9a9ae9ee79..be1a98de78 100644
--- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs
@@ -375,7 +375,7 @@ public static partial class SqlClientMetaDataCollectionNames
///
public static readonly string ColumnSetColumns;
}
-#if NETCORE || NETSTANDARD21_AND_ABOVE
+#if NETCOREAPP || NETSTANDARD21_AND_ABOVE
///
public enum SqlConnectionAttestationProtocol
{
@@ -848,7 +848,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 NETCORE || NETSTANDARD21_AND_ABOVE
+#if NETCOREAPP || NETSTANDARD21_AND_ABOVE
///
[System.ComponentModel.DisplayNameAttribute("Attestation Protocol")]
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
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 81399b6022..9a6db6b167 100644
--- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj
@@ -12,11 +12,11 @@
netstandard
AnyCPU;x64;x86
-
+
$(DefineConstants);NETSTANDARD21_AND_ABOVE
- $(DefineConstants);NETCORE
+ $(DefineConstants);NETCOREAPP
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 f717a72a6a..2eaa0c9b08 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
@@ -20,13 +20,13 @@
Core $(BaseProduct)
- $(DefineConstants);netcoreapp;
+ $(DefineConstants);NETCOREAPP;
- $(DefineConstants);netstandard;
+ $(DefineConstants);NETSTANDARD;
-
- $(DefineConstants);NETCORE3
+
+ $(DefineConstants);NETCOREAPP31_AND_ABOVE
portable
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Common/DbConnectionStringCommon.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Common/DbConnectionStringCommon.cs
index ee9544b4ce..eb23fcdfef 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Common/DbConnectionStringCommon.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Common/DbConnectionStringCommon.cs
@@ -780,7 +780,7 @@ internal static partial class DbConnectionStringKeywords
internal const string MaxPoolSize = "Max Pool Size";
internal const string Pooling = "Pooling";
internal const string MinPoolSize = "Min Pool Size";
-#if netcoreapp
+#if NETCOREAPP
internal const string PoolBlockingPeriod = "Pool Blocking Period";
#endif
}
@@ -839,7 +839,7 @@ internal static class DbConnectionStringSynonyms
internal const string NET = "net";
internal const string NETWORK = "network";
-#if netcoreapp
+#if NETCOREAPP
//internal const string PoolBlockingPeriod = POOLBLOCKINGPERIOD;
internal const string POOLBLOCKINGPERIOD = "PoolBlockingPeriod";
#endif
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs
index 9099427e7f..b072a4fa01 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs
@@ -815,7 +815,7 @@ public override void KillConnection()
internal static void SetKeepAliveValues(ref Socket socket)
{
-#if NETCORE3
+#if NETCOREAPP31_AND_ABOVE
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveInterval, 1);
socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveTime, 30);
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionString.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionString.cs
index 7e58eaf4a2..aa9023139c 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionString.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionString.cs
@@ -63,7 +63,7 @@ internal static class KEY
internal const string Application_Name = "application name";
internal const string AsynchronousProcessing = "asynchronous processing";
internal const string AttachDBFilename = "attachdbfilename";
-#if netcoreapp
+#if NETCOREAPP
internal const string PoolBlockingPeriod = "pool blocking period";
#endif
internal const string ColumnEncryptionSetting = "column encryption setting";
@@ -141,7 +141,7 @@ private static class SYNONYM
// network library
internal const string NET = "net";
internal const string NETWORK = "network";
-#if netcoreapp
+#if NETCOREAPP
// pool blocking period
internal const string POOLBLOCKINGPERIOD = "poolblockingperiod";
#endif
@@ -159,7 +159,7 @@ private static class SYNONYM
// make sure to update SynonymCount value below when adding or removing synonyms
}
-#if netcoreapp
+#if NETCOREAPP
internal const int SynonymCount = 25;
#else
internal const int SynonymCount = 24;
@@ -258,7 +258,7 @@ internal SqlConnectionString(string connectionString) : base(connectionString, G
}
_integratedSecurity = ConvertValueToIntegratedSecurity();
-#if netcoreapp
+#if NETCOREAPP
_poolBlockingPeriod = ConvertValueToPoolBlockingPeriod();
#endif
_encrypt = ConvertValueToBoolean(KEY.Encrypt, DEFAULT.Encrypt);
@@ -511,7 +511,7 @@ internal SqlConnectionString(SqlConnectionString connectionOptions, string dataS
_commandTimeout = connectionOptions._commandTimeout;
_connectTimeout = connectionOptions._connectTimeout;
_loadBalanceTimeout = connectionOptions._loadBalanceTimeout;
-#if netcoreapp
+#if NETCOREAPP
_poolBlockingPeriod = connectionOptions._poolBlockingPeriod;
#endif
_maxPoolSize = connectionOptions._maxPoolSize;
@@ -650,7 +650,7 @@ internal static Dictionary GetParseSynonyms()
{ KEY.Application_Name, KEY.Application_Name },
{ KEY.AsynchronousProcessing, KEY.AsynchronousProcessing },
{ KEY.AttachDBFilename, KEY.AttachDBFilename },
-#if netcoreapp
+#if NETCOREAPP
{ KEY.PoolBlockingPeriod, KEY.PoolBlockingPeriod},
#endif
{ KEY.Command_Timeout, KEY.Command_Timeout },
@@ -703,7 +703,7 @@ internal static Dictionary GetParseSynonyms()
{ SYNONYM.MULTIPLEACTIVERESULTSETS, KEY.MARS },
{ SYNONYM.MULTISUBNETFAILOVER, KEY.MultiSubnetFailover },
{ SYNONYM.NETWORK_ADDRESS, KEY.Data_Source },
-#if netcoreapp
+#if NETCOREAPP
{ SYNONYM.POOLBLOCKINGPERIOD, KEY.PoolBlockingPeriod},
#endif
{ SYNONYM.SERVER, KEY.Data_Source },
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionStringBuilder.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionStringBuilder.cs
index 2c4d110254..0a7a06659a 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionStringBuilder.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionStringBuilder.cs
@@ -33,7 +33,7 @@ private enum Keywords
Pooling,
MinPoolSize,
MaxPoolSize,
-#if netcoreapp
+#if NETCOREAPP
PoolBlockingPeriod,
#endif
MultipleActiveResultSets,
@@ -114,7 +114,7 @@ private static string[] CreateValidKeywords()
validKeywords[(int)Keywords.ApplicationIntent] = DbConnectionStringKeywords.ApplicationIntent;
validKeywords[(int)Keywords.ApplicationName] = DbConnectionStringKeywords.ApplicationName;
validKeywords[(int)Keywords.AttachDBFilename] = DbConnectionStringKeywords.AttachDBFilename;
-#if netcoreapp
+#if NETCOREAPP
validKeywords[(int)Keywords.PoolBlockingPeriod] = DbConnectionStringKeywords.PoolBlockingPeriod;
#endif
validKeywords[(int)Keywords.CommandTimeout] = DbConnectionStringKeywords.CommandTimeout;
@@ -158,7 +158,7 @@ private static Dictionary CreateKeywordsDictionary()
hash.Add(DbConnectionStringKeywords.ApplicationIntent, Keywords.ApplicationIntent);
hash.Add(DbConnectionStringKeywords.ApplicationName, Keywords.ApplicationName);
hash.Add(DbConnectionStringKeywords.AttachDBFilename, Keywords.AttachDBFilename);
-#if netcoreapp
+#if NETCOREAPP
hash.Add(DbConnectionStringKeywords.PoolBlockingPeriod, Keywords.PoolBlockingPeriod);
#endif
hash.Add(DbConnectionStringKeywords.CommandTimeout, Keywords.CommandTimeout);
@@ -208,7 +208,7 @@ private static Dictionary CreateKeywordsDictionary()
hash.Add(DbConnectionStringSynonyms.MULTIPLEACTIVERESULTSETS, Keywords.MultipleActiveResultSets);
hash.Add(DbConnectionStringSynonyms.MULTISUBNETFAILOVER, Keywords.MultiSubnetFailover);
hash.Add(DbConnectionStringSynonyms.NETWORKADDRESS, Keywords.DataSource);
-#if netcoreapp
+#if NETCOREAPP
hash.Add(DbConnectionStringSynonyms.POOLBLOCKINGPERIOD, Keywords.PoolBlockingPeriod);
#endif
hash.Add(DbConnectionStringSynonyms.SERVER, Keywords.DataSource);
@@ -326,7 +326,7 @@ public override object this[string keyword]
case Keywords.AttestationProtocol:
AttestationProtocol = ConvertToAttestationProtocol(keyword, value);
break;
-#if netcoreapp
+#if NETCOREAPP
case Keywords.PoolBlockingPeriod: PoolBlockingPeriod = ConvertToPoolBlockingPeriod(keyword, value); break;
#endif
case Keywords.Encrypt:
@@ -914,7 +914,7 @@ private object GetAt(Keywords index)
return ApplicationName;
case Keywords.AttachDBFilename:
return AttachDBFilename;
-#if netcoreapp
+#if NETCOREAPP
case Keywords.PoolBlockingPeriod: return PoolBlockingPeriod;
#endif
case Keywords.CommandTimeout:
@@ -1029,7 +1029,7 @@ private void Reset(Keywords index)
case Keywords.Authentication:
_authentication = DbConnectionStringDefaults.Authentication;
break;
-#if netcoreapp
+#if NETCOREAPP
case Keywords.PoolBlockingPeriod:
_poolBlockingPeriod = DbConnectionStringDefaults.PoolBlockingPeriod;
break;
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 70cecd2e3f..c4c27098ca 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
@@ -1658,7 +1658,7 @@ internal void WriteInt(int v, TdsParserStateObject stateObj)
internal static void WriteInt(Span buffer, int value)
{
-#if netcoreapp
+#if NETCOREAPP
BitConverter.TryWriteBytes(buffer, value);
#else
buffer[0] = (byte)(value & 0xff);
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsValueSetter.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsValueSetter.cs
index 7ab4ad5403..08e0aefaec 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsValueSetter.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsValueSetter.cs
@@ -561,7 +561,7 @@ internal void SetDateTime(DateTime value)
_stateObj.Parser.WriteInt(dt.time, _stateObj);
}
- // Clean the variant metadata to prevent sharing it with next row.
+ // Clean the variant metadata to prevent sharing it with next row.
// As a reminder, SetVariantType raises an assert if _variantType is not clean
_variantType = null;
}
@@ -601,7 +601,7 @@ internal void SetGuid(Guid value)
Debug.Assert(
SmiXetterAccessMap.IsSetterAccessValid(_metaData, SmiXetterTypeCode.XetGuid));
-#if netcoreapp
+#if NETCOREAPP
Span bytes = stackalloc byte[16];
value.TryWriteBytes(bytes);
@@ -620,7 +620,7 @@ internal void SetGuid(Guid value)
_stateObj.WriteByte((byte)_metaData.MaxLength);
}
-#if netcoreapp
+#if NETCOREAPP
_stateObj.WriteByteSpan(bytes);
#else
_stateObj.WriteByteArray(bytes, bytes.Length, 0);
@@ -660,7 +660,7 @@ internal void SetDateTimeOffset(DateTimeOffset value)
byte length;
if (SqlDbType.Variant == _metaData.SqlDbType)
{
- // VSTFDevDiv #885208 - DateTimeOffset throws ArgumentException for when passing DateTimeOffset value to a sql_variant TVP
+ // VSTFDevDiv #885208 - DateTimeOffset throws ArgumentException for when passing DateTimeOffset value to a sql_variant TVP
// using a SqlDataRecord or SqlDataReader
SmiMetaData dateTimeOffsetMetaData = SmiMetaData.DefaultDateTimeOffset;
scale = MetaType.MetaDateTimeOffset.Scale;
diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj
index 7b3a6a1181..b12183ebdd 100644
--- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj
@@ -20,7 +20,7 @@
True
- $(DefineConstants);netfx;
+ $(DefineConstants);NETFRAMEWORK;
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 801b4df97a..507d34b103 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.cs
@@ -66,14 +66,14 @@ public override void BeforeUnload(SqlAuthenticationMethod authentication)
_logger.LogInfo(_type, "BeforeUnload", $"being unloaded from SqlAuthProviders for {authentication}.");
}
-#if netstandard
+#if NETSTANDARD
private Func