diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Handles/SafeLibraryHandle.netcore.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Handles/SafeLibraryHandle.netcore.cs
index 54512985f1..35142e1ee8 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Handles/SafeLibraryHandle.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Handles/SafeLibraryHandle.netcore.cs
@@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#if NET && _WINDOWS
+#if NET
using Microsoft.Win32.SafeHandles;
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Kernel32/Kernel32.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Kernel32/Kernel32.cs
index 020726b104..5ff162d69e 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Kernel32/Kernel32.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Kernel32/Kernel32.cs
@@ -8,7 +8,7 @@
using Microsoft.Data.Common;
using Microsoft.Win32.SafeHandles;
-#if !NETFRAMEWORK && _WINDOWS
+#if NET
using Interop.Windows.Handles;
#endif
@@ -19,11 +19,6 @@ internal static class Kernel32
internal const ushort FILE_DEVICE_FILE_SYSTEM = 0x0009;
internal const uint SEM_FAILCRITICALERRORS = 1;
- #if _WINDOWS && !NETFRAMEWORK
- internal const int LOAD_LIBRARY_AS_DATAFILE = 0x00000002;
- internal const int LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800;
- #endif
-
private const string DllName = "kernel32.dll";
/// CTL_CODE method.
@@ -54,7 +49,7 @@ internal static extern bool DeviceIoControl(
out uint cbBytesReturned,
IntPtr overlapped);
- #if NET && _WINDOWS
+ #if NET
[DllImport(DllName, ExactSpelling = true, SetLastError = true)]
public static extern bool FreeLibrary([In] IntPtr hModule);
#endif
@@ -71,7 +66,7 @@ internal static extern int GetFullPathName(
IntPtr lpFilePartOrNull);
#endif
- #if NET && _WINDOWS
+ #if NET
[DllImport(DllName, CharSet = CharSet.Ansi, BestFitMapping = false)]
public static extern IntPtr GetProcAddress(IntPtr hModule, string lpProcName);
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Kernel32/Kernel32Safe.netfx.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Kernel32/Kernel32Safe.netfx.cs
index 874614765f..95a5d81440 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Kernel32/Kernel32Safe.netfx.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Kernel32/Kernel32Safe.netfx.cs
@@ -1,8 +1,8 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// 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 NETFRAMEWORK && _WINDOWS
+#if NETFRAMEWORK
using System;
using System.Runtime.InteropServices;
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/AuthProviderInfo.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/AuthProviderInfo.cs
index e273e5fc1b..7b0818b7c5 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/AuthProviderInfo.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/AuthProviderInfo.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 _WINDOWS
-
using System.Runtime.InteropServices;
namespace Interop.Windows.Sni
@@ -25,5 +23,3 @@ internal struct AuthProviderInfo
public string serverCertFileName;
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/ConsumerInfo.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/ConsumerInfo.cs
index fcb7b9a20d..358e35cda0 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/ConsumerInfo.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/ConsumerInfo.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 _WINDOWS
-
using System;
using System.Runtime.InteropServices;
@@ -18,5 +16,3 @@ internal struct ConsumerInfo
internal IntPtr key;
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/ConsumerNumber.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/ConsumerNumber.cs
index f7b11801c9..a1d4fdf292 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/ConsumerNumber.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/ConsumerNumber.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 _WINDOWS
-
namespace Interop.Windows.Sni
{
internal enum ConsumerNumber
@@ -14,5 +12,3 @@ internal enum ConsumerNumber
SNI_Consumer_Invalid,
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/Delegates.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/Delegates.cs
index 720ad481e4..fd1f2d8e39 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/Delegates.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/Delegates.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 _WINDOWS
-
using System;
using System.Runtime.InteropServices;
@@ -14,5 +12,3 @@ namespace Interop.Windows.Sni
internal delegate IntPtr SqlClientCertificateDelegate(IntPtr pCallbackContext);
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/IoType.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/IoType.cs
index ef02350e84..167a7a23b5 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/IoType.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/IoType.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 _WINDOWS
-
namespace Interop.Windows.Sni
{
internal enum IoType
@@ -12,5 +10,3 @@ internal enum IoType
WRITE,
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/Prefix.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/Prefix.cs
index 52c98bfde9..45ec71a2cf 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/Prefix.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/Prefix.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 _WINDOWS
-
namespace Interop.Windows.Sni
{
internal enum Prefix
@@ -16,5 +14,3 @@ internal enum Prefix
INVALID_PREFIX,
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/Provider.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/Provider.cs
index c9bf7a980c..61b33ebfc1 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/Provider.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/Provider.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 _WINDOWS
-
namespace Interop.Windows.Sni
{
internal enum Provider
@@ -26,5 +24,3 @@ internal enum Provider
INVALID_PROV,
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/QueryType.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/QueryType.cs
index 14de40336f..5fca987240 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/QueryType.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/QueryType.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 _WINDOWS
-
namespace Interop.Windows.Sni
{
internal enum QueryType
@@ -49,5 +47,3 @@ internal enum QueryType
#endif
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniClientConsumerInfo.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniClientConsumerInfo.cs
index 89199e4417..062c36679f 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniClientConsumerInfo.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniClientConsumerInfo.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 _WINDOWS
-
using System.Runtime.InteropServices;
using Microsoft.Data.SqlClient;
@@ -36,5 +34,3 @@ internal unsafe struct SniClientConsumerInfo
public SniDnsCacheInfo DNSCacheInfo;
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniConsumerInfo.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniConsumerInfo.cs
index 8cb27dfb5f..2f084f228d 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniConsumerInfo.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniConsumerInfo.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 _WINDOWS
-
using System;
using System.Runtime.InteropServices;
@@ -23,5 +21,3 @@ internal struct SniConsumerInfo
public IntPtr NodeAffinity;
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniDnsCacheInfo.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniDnsCacheInfo.cs
index 1d5600aec9..e0e3c91efe 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniDnsCacheInfo.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniDnsCacheInfo.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 _WINDOWS
-
using System.Runtime.InteropServices;
namespace Interop.Windows.Sni
@@ -21,5 +19,3 @@ internal struct SniDnsCacheInfo
public string wszCachedTcpPort;
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniError.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniError.cs
index 55f64a32d3..2e519c15ab 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniError.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniError.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 _WINDOWS
-
using System.Runtime.InteropServices;
namespace Interop.Windows.Sni
@@ -23,5 +21,3 @@ internal struct SniError
internal uint lineNumber;
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniSslProtocols.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniSslProtocols.cs
index f070082c16..cd9bf47ed3 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniSslProtocols.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SniSslProtocols.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 _WINDOWS
-
namespace Interop.Windows.Sni
{
internal enum SniSslProtocols : uint
@@ -32,5 +30,3 @@ internal enum SniSslProtocols : uint
SP_PROT_TLS1_3 = SP_PROT_TLS1_3_SERVER | SP_PROT_TLS1_3_CLIENT,
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SqlDependencyProcessDispatcherStorage.netfx.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SqlDependencyProcessDispatcherStorage.netfx.cs
index dc5b5be57e..57481d18b3 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SqlDependencyProcessDispatcherStorage.netfx.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/SqlDependencyProcessDispatcherStorage.netfx.cs
@@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#if NETFRAMEWORK && _WINDOWS
+#if NETFRAMEWORK
using System;
using System.Diagnostics;
diff --git a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/TransparentNetworkResolutionMode.cs b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/TransparentNetworkResolutionMode.cs
index 8d1ac82449..fe68cd420d 100644
--- a/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/TransparentNetworkResolutionMode.cs
+++ b/src/Microsoft.Data.SqlClient/src/Interop/Windows/Sni/TransparentNetworkResolutionMode.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 _WINDOWS
-
namespace Interop.Windows.Sni
{
internal enum TransparentNetworkResolutionMode : byte
@@ -13,5 +11,3 @@ internal enum TransparentNetworkResolutionMode : byte
ParallelMode
}
}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj
index 06eaf9e914..fbaac6b755 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj
@@ -235,7 +235,9 @@
+ Condition="'$(NormalizedTargetOs)' == 'windows_nt' AND '$(TargetFramework)' != 'net462'">
+ ILLink.Substitutions.xml
+
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.netfx.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.netfx.cs
index 99f627d603..d1d001448e 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.netfx.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.netfx.cs
@@ -13,9 +13,7 @@
using System.Text;
using System.Threading.Tasks;
-#if _WINDOWS
using Interop.Windows.Kernel32;
-#endif
namespace Microsoft.Data.Common
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Diagnostics/SqlClientMetrics.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Diagnostics/SqlClientMetrics.cs
index ed27a9591f..cb8c224440 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Diagnostics/SqlClientMetrics.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Diagnostics/SqlClientMetrics.cs
@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// 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.
@@ -9,9 +9,7 @@
#if NET
using System.Threading;
#else
-#if _WINDOWS
using Interop.Windows.Kernel32;
-#endif
using Microsoft.Data.Common;
using System.Diagnostics;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalAppContextSwitches.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalAppContextSwitches.cs
index 85f8c87937..06bf6c4f0e 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalAppContextSwitches.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalAppContextSwitches.cs
@@ -139,7 +139,7 @@ internal static class LocalAppContextSwitches
private const string UseOverallConnectTimeoutForPoolWaitString =
"Switch.Microsoft.Data.SqlClient.UseOverallConnectTimeoutForPoolWait";
- #if NET && _WINDOWS
+ #if NET
///
/// The name of the app context switch that controls whether to use the
/// managed SNI implementation instead of the native SNI implementation on
@@ -258,7 +258,7 @@ private enum SwitchValue : byte
///
private static SwitchValue s_useOverallConnectTimeoutForPoolWait = SwitchValue.None;
- #if NET && _WINDOWS
+ #if NET
///
/// The cached value of the UseManagedNetworking switch.
///
@@ -612,7 +612,7 @@ public static bool UseCompatibilityAsyncBehaviour
defaultValue: false,
ref s_useOverallConnectTimeoutForPoolWait);
- #if NET && _WINDOWS
+ #if NET
///
/// When set to true, .NET on Windows will use the managed SNI
/// implementation instead of the native SNI implementation.
@@ -621,24 +621,22 @@ public static bool UseCompatibilityAsyncBehaviour
/// trimmed away when the corresponding AppContext switch is set at compile
/// time. In such cases, this property will return a constant value, even if
/// the AppContext switch is set or reset at runtime. See the
- /// ILLink.Substitutions.Windows.xml and ILLink.Substitutions.Unix.xml
- /// resource files for details.
+ /// ILLink.Substitutions.xml resource file for details.
///
- /// The default value of this switch is false.
+ /// The default value of this switch is false on Windows and true on non-Windows platforms.
///
public static bool UseManagedNetworking
{
get
{
- if (s_useManagedNetworking != SwitchValue.None)
+ if (!OsConstants.IsWindows)
{
- return s_useManagedNetworking == SwitchValue.True;
+ return true;
}
- if (!OsConstants.IsWindows)
+ if (s_useManagedNetworking != SwitchValue.None)
{
- s_useManagedNetworking = SwitchValue.True;
- return true;
+ return s_useManagedNetworking == SwitchValue.True;
}
if (AppContext.TryGetSwitch(UseManagedNetworkingOnWindowsString, out bool returnedValue) && returnedValue)
@@ -651,12 +649,6 @@ public static bool UseManagedNetworking
return false;
}
}
- #elif NET
- ///
- /// .NET Core on Unix does not support native SNI, so this will always be
- /// true.
- ///
- public static bool UseManagedNetworking => true;
#else
///
/// .NET Framework does not support the managed SNI, so this will always be
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.windows.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.cs
similarity index 96%
rename from src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.windows.cs
rename to src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.cs
index bd45d307a1..6dfa1c351f 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.windows.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.cs
@@ -1,8 +1,8 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// 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 NET && _WINDOWS
+#if NET
using System;
using System.Runtime.InteropServices;
@@ -11,6 +11,7 @@
using Interop.Windows.Kernel32;
using Microsoft.Win32;
using Microsoft.Data.SqlClient.Internal;
+using Microsoft.Data.Common;
namespace Microsoft.Data.SqlClient.ManagedSni
{
@@ -44,8 +45,16 @@ [Out] [MarshalAs(UnmanagedType.LPWStr)] StringBuilder sqlConnectionDataSource,
private LocalDB() { }
- internal static string GetLocalDBConnectionString(string localDbInstance) =>
- Instance.LoadUserInstanceDll() ? Instance.GetConnectionString(localDbInstance) : null;
+ internal static string GetLocalDBConnectionString(string localDbInstance)
+ {
+ // LocalDB is not available for Unix and hence it cannot be supported.
+ if (!OsConstants.IsWindows)
+ {
+ throw new PlatformNotSupportedException(Strings.LocalDBNotSupported);
+ }
+
+ return Instance.LoadUserInstanceDll() ? Instance.GetConnectionString(localDbInstance) : null;
+ }
internal static IntPtr GetProcAddress(string functionName) =>
Instance.LoadUserInstanceDll() ? Kernel32.GetProcAddress(LocalDB.Instance._sqlUserInstanceLibraryHandle, functionName) : IntPtr.Zero;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.unix.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.unix.cs
deleted file mode 100644
index 64ba1da0f8..0000000000
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.unix.cs
+++ /dev/null
@@ -1,20 +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 NET && _UNIX
-
-using System;
-
-namespace Microsoft.Data.SqlClient.ManagedSni
-{
- internal class LocalDB
- {
- internal static string GetLocalDBConnectionString(string localDbInstance)
- {
- throw new PlatformNotSupportedException(Strings.LocalDBNotSupported); // LocalDB is not available for Unix and hence it cannot be supported.
- }
- }
-}
-
-#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs
index a101099dd8..0e9df041de 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs
@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// 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.
@@ -20,9 +20,7 @@
using System.Runtime.Remoting;
using System.Runtime.Serialization;
using System.Security.Permissions;
-#if _WINDOWS
using Interop.Windows.Sni;
-#endif
using Microsoft.Data.SqlClient.LocalDb;
#endif