diff --git a/eng/pipelines/jobs/pack-abstractions-package-ci-job.yml b/eng/pipelines/jobs/pack-abstractions-package-ci-job.yml
index c928baa62d..4fd0d8d73d 100644
--- a/eng/pipelines/jobs/pack-abstractions-package-ci-job.yml
+++ b/eng/pipelines/jobs/pack-abstractions-package-ci-job.yml
@@ -81,7 +81,6 @@ jobs:
value: >-
$(commonArguments)
--configuration ${{ parameters.buildConfiguration }}
- -p:ForceMdsAssemblyNameSuffix=true
-p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }}
# Explicitly unset the $PLATFORM environment variable that is set by the
diff --git a/eng/pipelines/jobs/pack-azure-package-ci-job.yml b/eng/pipelines/jobs/pack-azure-package-ci-job.yml
index c2f6e408fe..837fcc5409 100644
--- a/eng/pipelines/jobs/pack-azure-package-ci-job.yml
+++ b/eng/pipelines/jobs/pack-azure-package-ci-job.yml
@@ -100,7 +100,6 @@ jobs:
value: >-
--verbosity ${{ parameters.dotnetVerbosity }}
-p:ReferenceType=${{ parameters.referenceType }}
- -p:ForceMdsAssemblyNameSuffix=true
-p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }}
# dotnet CLI arguments for build/test/pack commands
diff --git a/eng/pipelines/jobs/test-abstractions-package-ci-job.yml b/eng/pipelines/jobs/test-abstractions-package-ci-job.yml
index 965c2d7d0c..a4fea75efa 100644
--- a/eng/pipelines/jobs/test-abstractions-package-ci-job.yml
+++ b/eng/pipelines/jobs/test-abstractions-package-ci-job.yml
@@ -98,7 +98,6 @@ jobs:
value: >-
$(commonArguments)
--configuration ${{ parameters.buildConfiguration }}
- -p:ForceMdsAssemblyNameSuffix=true
# Explicitly unset the $PLATFORM environment variable that is set by the
# 'ADO Build properties' Library in the ADO SqlClientDrivers public project.
diff --git a/eng/pipelines/jobs/test-azure-package-ci-job.yml b/eng/pipelines/jobs/test-azure-package-ci-job.yml
index afba00dc03..288030f3b8 100644
--- a/eng/pipelines/jobs/test-azure-package-ci-job.yml
+++ b/eng/pipelines/jobs/test-azure-package-ci-job.yml
@@ -97,6 +97,18 @@ parameters:
- Package
- Project
+ # Steps to run, if any, to configure a local SQL Server instance on the agent
+ # VM.
+ - name: sqlServerSetupSteps
+ type: stepList
+ default: []
+
+ # True if the VM image includes a local SQL Server that supports connections
+ # via integrated security.
+ - name: supportsIntegratedSecurity
+ type: boolean
+ default: false
+
# The pool VM image to use.
- name: vmImage
type: string
@@ -129,16 +141,24 @@ jobs:
value: >-
--verbosity ${{ parameters.dotnetVerbosity }}
-p:ReferenceType=${{ parameters.referenceType }}
- -p:ForceMdsAssemblyNameSuffix=true
-p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }}
-p:MdsPackageVersion=${{ parameters.mdsPackageVersion }}
- # dotnet CLI arguments for build/test/pack commands
+ # dotnet CLI arguments for build/test/pack commands.
- name: buildArguments
value: >-
$(commonArguments)
--configuration ${{ parameters.buildConfiguration }}
+ # dotnet CLI arguments for test commands.
+ #
+ # Filter out tests annotated with the ActiveIssue attribute, which for
+ # some reason uses the category 'failing' rather than 'ActiveIssue'.
+ #
+ - name: testArguments
+ value: >-
+ --filter "category != failing"
+
# Explicitly unset the $PLATFORM environment variable that is set by the
# 'ADO Build properties' Library in the ADO SqlClientDrivers public
# project. This is defined with a non-standard Platform of 'AnyCPU', and
@@ -232,19 +252,25 @@ jobs:
AzureKeyVaultTenantId: $(AzureKeyVaultTenantId)
# macOS doesn't support managed identities.
ManagedIdentitySupported: ${{ not(eq(parameters.vmImage, 'macos-latest')) }}
- SupportsIntegratedSecurity: ${{ eq(variables['SupportsIntegratedSecurity'], 'true') }}
+ SupportsIntegratedSecurity: ${{ parameters.supportsIntegratedSecurity }}
TCPConnectionString: $(AZURE_DB_TCP_CONN_STRING)
UserManagedIdentityClientId: $(UserManagedIdentityClientId)
WorkloadIdentityFederationServiceConnectionId: $(WorkloadIdentityFederationServiceConnectionId)
- # Note: Using the isFork variable to determine if secrets are
- # available is not ideal since it's an indirect association. But
- # everything else (referencing secret variables various ways to detect
- # if they were present) won't run consistently across forks and
- # non-forks.
+ # Avoid exposing secrets to pipeline jobs triggered via forks. This
+ # prevents external contributors from creating PRs and running
+ # pipelines that could expose these secrets.
+ #
+ # Note that this isn't a perfect restriction since internal
+ # contributors may want to use forks, but this would prevent them from
+ # running the full test suite. We don't have a better way to detect
+ # external parties though.
${{ if eq(variables['system.pullRequest.isFork'], 'False') }}:
AADPasswordConnectionString: $(AAD_PASSWORD_CONN_STR)
AADServicePrincipalSecret: $(AADServicePrincipalSecret)
+ # Perform any local SQL Server setup.
+ - ${{ parameters.sqlServerSetupSteps }}
+
# We use the 'custom' command because the DotNetCoreCLI@2 task doesn't
# support all of our argument combinations for the different build steps.
@@ -282,7 +308,7 @@ jobs:
# Many of our tests require access to Azure resources that are
# currently only granted by agents running our custom ADO 1ES
# images in our ADO pools.
- ${{ if startsWith(parameters.poolName, 'ADO-') }}:
+ ${{ if ne(parameters.poolName, 'Azure Pipelines') }}:
ADO_POOL: 1
# When using connectedServiceName below, the DotNetCoreCLI task
# needs the system access token to be injected as this environment
@@ -299,14 +325,14 @@ jobs:
command: custom
custom: test
projects: $(project)
- arguments: $(buildArguments) --no-build -f ${{ runtime }}
+ arguments: $(buildArguments) $(testArguments) --no-build -f ${{ runtime }}
# Run the tests for each .NET Framework runtime.
- ${{ each runtime in parameters.netFrameworkRuntimes }}:
- task: DotNetCoreCLI@2
displayName: Test [${{ runtime }}]
env:
- ${{ if startsWith(parameters.poolName, 'ADO-CI') }}:
+ ${{ if ne(parameters.poolName, 'Azure Pipelines') }}:
ADO_POOL: 1
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
${{ if eq(parameters.debug, true) }}:
@@ -316,4 +342,4 @@ jobs:
command: custom
custom: test
projects: $(project)
- arguments: $(buildArguments) --no-build -f ${{ runtime }}
+ arguments: $(buildArguments) $(testArguments) --no-build -f ${{ runtime }}
diff --git a/eng/pipelines/stages/build-azure-package-ci-stage.yml b/eng/pipelines/stages/build-azure-package-ci-stage.yml
index 26b1d0d1eb..35504b2c85 100644
--- a/eng/pipelines/stages/build-azure-package-ci-stage.yml
+++ b/eng/pipelines/stages/build-azure-package-ci-stage.yml
@@ -46,8 +46,8 @@ parameters:
#
# Any pool specified here must contain images with the following names:
#
+ # - ADO-MMS22-SQL22
# - ADO-UB22-SQL22
- # - ADO-CI-Win11
#
default: $(ci_var_defaultPoolName)
@@ -139,7 +139,7 @@ stages:
debug: ${{ parameters.debug }}
displayNamePrefix: Linux
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
- jobNameSuffix: linux_basic
+ jobNameSuffix: linux
mdsArtifactName: MDS.Artifact
mdsPackageVersion: ${{ parameters.mdsPackageVersion }}
netFrameworkRuntimes: []
@@ -155,15 +155,25 @@ stages:
abstractionsPackageVersion: ${{ parameters.abstractionsPackageVersion }}
buildConfiguration: ${{ parameters.buildConfiguration }}
debug: ${{ parameters.debug }}
- displayNamePrefix: Linux
+ displayNamePrefix: Linux Integration
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
- jobNameSuffix: linux_comprehensive
+ jobNameSuffix: linux_integration
mdsArtifactName: MDS.Artifact
mdsPackageVersion: ${{ parameters.mdsPackageVersion }}
netFrameworkRuntimes: []
netRuntimes: [net8.0, net9.0, net10.0]
poolName: ${{ parameters.adoPoolName }}
referenceType: ${{ parameters.referenceType }}
+ # The image includes a SQL Server instance that we must configure.
+ sqlServerSetupSteps:
+ - template: /eng/pipelines/common/templates/steps/configure-sql-server-linux-step.yml@self
+ parameters:
+ # Override the template's default step condition. We always
+ # want this step to run.
+ condition: true
+ # Use the Azure DevOps Library variable "password" for the SA
+ # password.
+ password: $(password)
vmImage: ADO-UB22-SQL22
# ------------------------------------------------------------------------
@@ -178,7 +188,7 @@ stages:
debug: ${{ parameters.debug }}
displayNamePrefix: Win
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
- jobNameSuffix: windows_basic
+ jobNameSuffix: windows
mdsArtifactName: MDS.Artifact
mdsPackageVersion: ${{ parameters.mdsPackageVersion }}
netFrameworkRuntimes: [net462]
@@ -194,16 +204,33 @@ stages:
abstractionsPackageVersion: ${{ parameters.abstractionsPackageVersion }}
buildConfiguration: ${{ parameters.buildConfiguration }}
debug: ${{ parameters.debug }}
- displayNamePrefix: Win
+ displayNamePrefix: Win Integration
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
- jobNameSuffix: windows_comprehensive
+ jobNameSuffix: windows_integration
mdsArtifactName: MDS.Artifact
mdsPackageVersion: ${{ parameters.mdsPackageVersion }}
netFrameworkRuntimes: [net462]
netRuntimes: [net8.0, net9.0, net10.0]
poolName: ${{ parameters.adoPoolName }}
referenceType: ${{ parameters.referenceType }}
- vmImage: ADO-CI-Win11
+ # The image includes a SQL Server instance that we must configure.
+ sqlServerSetupSteps:
+ - template: /eng/pipelines/common/templates/steps/configure-sql-server-win-step.yml@self
+ # Use defaults for most parameters.
+ parameters:
+ # Override the template's default step condition. We always
+ # want this step to run.
+ condition: true
+ enableLocalDB: true
+ # These variables are from an Azure DevOps Library variable
+ # group.
+ fileStreamDirectory: $(FileStreamDirectory)
+ password: $(password)
+ sqlRootPath: $(SQL22RootPath)
+ # The ADO-MMS22-SQL22 image includes a local SQL Server that supports
+ # integrated security.
+ supportsIntegratedSecurity: true
+ vmImage: ADO-MMS22-SQL22
# ------------------------------------------------------------------------
# Build and test on macOS.
@@ -242,10 +269,10 @@ stages:
dependsOn:
# We depend on all of the test jobs to ensure the tests pass before
# producing the NuGet package.
- - test_azure_package_job_linux_basic
- - test_azure_package_job_linux_comprehensive
- - test_azure_package_job_windows_basic
- - test_azure_package_job_windows_comprehensive
+ - test_azure_package_job_linux
+ - test_azure_package_job_linux_integration
+ - test_azure_package_job_windows
+ - test_azure_package_job_windows_integration
- test_azure_package_job_macos
dotnetVerbosity: ${{ parameters.dotnetVerbosity }}
referenceType: ${{ parameters.referenceType }}
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index f38c666907..7a3e277e2a 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -153,43 +153,4 @@
14
-
-
-
- false
- true
-
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj
index 53652e0d8b..ddb74f9244 100644
--- a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj
+++ b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj
@@ -42,12 +42,6 @@
$(AbstractionsPackageVersion)
$(Artifacts)/doc/$(TargetFramework)/$(AssemblyName).xml
-
-
- $(DefineConstants);APPLY_MDS_ASSEMBLY_NAME_SUFFIX
@@ -86,7 +80,7 @@
dotnet.png
-
+
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProviderInternal.cs b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProviderInternal.cs
index 309edf4998..a1903e9279 100644
--- a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProviderInternal.cs
+++ b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProviderInternal.cs
@@ -32,20 +32,7 @@ private static class Internal
///
static Internal()
{
- // Choose the MDS assembly name based on compilation flags and the
- // runtime environment. See the top-level Directory.Build.props for
- // more information.
- string assemblyName = "Microsoft.Data.SqlClient";
- #if (APPLY_MDS_ASSEMBLY_NAME_SUFFIX)
- if (RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework"))
- {
- assemblyName += ".NetFx";
- }
- else
- {
- assemblyName += ".NetCore";
- }
- #endif
+ const string assemblyName = "Microsoft.Data.SqlClient";
// If the MDS package is present, load its
// SqlAuthenticationProviderManager class and get/set methods.
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Abstractions.Test.csproj b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Abstractions.Test.csproj
index 23e4ea451f..aeb752d648 100644
--- a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Abstractions.Test.csproj
+++ b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Abstractions.Test.csproj
@@ -9,14 +9,6 @@
Microsoft.Data.SqlClient.Extensions.Abstractions.Test
-
-
- $(DefineConstants);APPLY_MDS_ASSEMBLY_NAME_SUFFIX
-
-
@@ -33,7 +25,7 @@
-
+
PreserveNewest
xunit.runner.json
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/SqlAuthenticationProviderTest.cs b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/SqlAuthenticationProviderTest.cs
index 4c837332e5..07e2b40078 100644
--- a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/SqlAuthenticationProviderTest.cs
+++ b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/SqlAuthenticationProviderTest.cs
@@ -8,23 +8,14 @@ namespace Microsoft.Data.SqlClient.Extensions.Abstractions.Test;
public class SqlAuthenticationProviderTest
{
- // Choose the MDS assembly name based on compilation flags. See the
- // top-level Directory.Build.props for more information.
- #if (APPLY_MDS_ASSEMBLY_NAME_SUFFIX && NET)
- const string assemblyName = "Microsoft.Data.SqlClient.NetCore";
- #elif (APPLY_MDS_ASSEMBLY_NAME_SUFFIX && NETFRAMEWORK)
- const string assemblyName = "Microsoft.Data.SqlClient.NetFx";
- #else
- const string assemblyName = "Microsoft.Data.SqlClient";
- #endif
-
///
/// Construct to confirm preconditions.
///
public SqlAuthenticationProviderTest()
{
// Confirm that the MDS assembly is indeed not present.
- Assert.Throws(() => Assembly.Load(assemblyName));
+ Assert.Throws(
+ () => Assembly.Load("Microsoft.Data.SqlClient"));
}
#region Tests
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Azure/src/Azure.csproj b/src/Microsoft.Data.SqlClient.Extensions/Azure/src/Azure.csproj
index 74dba18d1f..9ebb0806ac 100644
--- a/src/Microsoft.Data.SqlClient.Extensions/Azure/src/Azure.csproj
+++ b/src/Microsoft.Data.SqlClient.Extensions/Azure/src/Azure.csproj
@@ -80,7 +80,7 @@
dotnet.png
-
+
-
+
@@ -121,6 +121,6 @@
-->
$(AssemblyName)
-
+
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Azure/test/AADConnectionTest.cs b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/AADConnectionTest.cs
index dda1afabef..dd6f3bcdf0 100644
--- a/src/Microsoft.Data.SqlClient.Extensions/Azure/test/AADConnectionTest.cs
+++ b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/AADConnectionTest.cs
@@ -194,9 +194,22 @@ public static void ActiveDirectoryDefaultMustPass()
ConnectAndDisconnect(connStr);
}
+ // This test works on main in the existing jobs (like Win22_Sql22), but
+ // fails in the Azure project tests on a similar agent/image:
+ //
+ // Failed Microsoft.Data.SqlClient.Extensions.Azure.Test.AADConnectionTest.ADIntegratedUsingSSPI [59 ms]
+ // Error Message:
+ // Microsoft.Data.SqlClient.SqlException : Failed to authenticate the user NT Authority\Anonymous Logon in Active Directory (Authentication=ActiveDirectoryIntegrated).
+ // Error code 0xget_user_name_failed
+ // Failed to acquire access token for ActiveDirectoryIntegrated: Failed to get user name.
+ //
+ // ActiveIssue tests can be filtered out of test runs on the dotnet CLI
+ // using the filter "category != failing".
+ //
+ [ActiveIssue("https://sqlclientdrivers.visualstudio.com/ADO.Net/_workitems/edit/40107")]
[ConditionalFact(
typeof(Config),
- nameof(Config.HasIntegratedSecurityConnectionString),
+ nameof(Config.SupportsIntegratedSecurity),
nameof(Config.HasTcpConnectionString))]
public static void ADIntegratedUsingSSPI()
{
@@ -209,9 +222,9 @@ public static void ADIntegratedUsingSSPI()
[ConditionalFact(
typeof(Config),
- nameof(Config.HasPasswordConnectionString),
nameof(Config.SupportsManagedIdentity),
- nameof(Config.SupportsSystemAssignedManagedIdentity))]
+ nameof(Config.SupportsSystemAssignedManagedIdentity),
+ nameof(Config.HasPasswordConnectionString))]
public static void SystemAssigned_ManagedIdentityTest()
{
string[] removeKeys = { "Authentication", "User ID", "Password", "UID", "PWD" };
@@ -235,9 +248,9 @@ public static void UserAssigned_ManagedIdentityTest()
[ConditionalFact(
typeof(Config),
- nameof(Config.HasTcpConnectionString),
nameof(Config.SupportsManagedIdentity),
nameof(Config.SupportsSystemAssignedManagedIdentity),
+ nameof(Config.HasTcpConnectionString),
nameof(Config.IsAzureSqlServer))]
public static void Azure_SystemManagedIdentityTest()
{
@@ -255,10 +268,10 @@ public static void Azure_SystemManagedIdentityTest()
[ConditionalFact(
typeof(Config),
+ nameof(Config.OnAdoPool),
+ nameof(Config.SupportsManagedIdentity),
nameof(Config.HasTcpConnectionString),
nameof(Config.HasUserManagedIdentityClientId),
- nameof(Config.SupportsManagedIdentity),
- nameof(Config.SupportsSystemAssignedManagedIdentity),
nameof(Config.IsAzureSqlServer))]
public static void Azure_UserManagedIdentityTest()
{
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj
index 592c4c3c56..bc4e5b14b1 100644
--- a/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj
+++ b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj
@@ -27,7 +27,7 @@
-
+
PreserveNewest
xunit.runner.json
@@ -41,21 +41,12 @@
tests into the artifacts. We don't refer to any of its assemblies.
-->
-
+
-
-
-
+
@@ -63,5 +54,4 @@
-
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Config.cs b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Config.cs
index 1db51d1c87..2a01a12384 100644
--- a/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Config.cs
+++ b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Config.cs
@@ -4,7 +4,6 @@
using System.Runtime.InteropServices;
using System.Text.Json;
-
using Microsoft.Data.SqlClient.TestUtilities;
namespace Microsoft.Data.SqlClient.Extensions.Azure.Test;
@@ -56,8 +55,6 @@ internal static class Config
#region Conditional Fact/Theory Helpers
- internal static bool HasIntegratedSecurityConnectionString() =>
- !TcpConnectionString.Empty() && IntegratedSecuritySupported;
internal static bool HasPasswordConnectionString() => !PasswordConnectionString.Empty();
internal static bool HasServicePrincipal() => !ServicePrincipalId.Empty() && !ServicePrincipalSecret.Empty();
internal static bool HasSystemAccessToken() => !SystemAccessToken.Empty();
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Azure/test/StringExtensions.cs b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/StringExtensions.cs
index acc7f10310..def794cc21 100644
--- a/src/Microsoft.Data.SqlClient.Extensions/Azure/test/StringExtensions.cs
+++ b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/StringExtensions.cs
@@ -2,8 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-// Adds the missing Empty() method to string that doesn't waste time on null
-// checks like String.IsNullOrEmpty() does, and has a nice short name.
+///
+/// Adds the missing Empty() method to string that doesn't waste time on null
+/// checks like String.IsNullOrEmpty() does, and has a nice short name.
+///
internal static class StringExtensions
{
internal static bool Empty(this string str)
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 d7821b8a35..8618e36fd7 100644
--- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj
@@ -1,11 +1,6 @@
-
Microsoft.Data.SqlClient
- $(AssemblyName).NetCore
net8.0;net9.0;netstandard2.0
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 70cb79a8b0..b0465b4756 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
@@ -1,11 +1,6 @@
-
Microsoft.Data.SqlClient
- $(AssemblyName).NetCore
net8.0;net9.0
diff --git a/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj
index 4cdfa44f73..e3e46f2349 100644
--- a/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj
@@ -1,11 +1,6 @@
-
Microsoft.Data.SqlClient
- $(AssemblyName).NetFx
net462
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 e3e1309607..1bcba9057c 100644
--- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj
@@ -1,11 +1,6 @@
-
Microsoft.Data.SqlClient
- $(AssemblyName).NetFx
net462
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj
index 9bc0137542..c17ce89279 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj
@@ -1,6 +1,7 @@
+ Microsoft.Data.SqlClient
Debug;Release;
true
@@ -15,11 +16,26 @@
$(SigningKeyPath)
+
+
+ net462;net8.0;net9.0
+
-
+
+ Windows_NT
$(OS)
@@ -34,13 +50,6 @@
$(DefineConstants);_WINDOWS
-
-
-
- net8.0;net9.0
- $(TargetFrameworks);net462
-
-
@@ -60,6 +69,26 @@
+
+
+
+ Microsoft.Data.SqlClient.Resources.Strings.resources
+ ResXFileCodeGenerator
+ Strings.Designer.cs
+ System
+
+
+
+
+ Microsoft.Data.SqlClient.Resources.%(Filename).resources
+
+
+
+
+ True
+ True
+ Strings.resx
+
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 c7427a6a8d..8b8d8b3c5b 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,7 +13,10 @@
using System.Security.Permissions;
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/ConnectionPool/DbConnectionPoolIdentity.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolIdentity.cs
index 7eca7bd0f6..057433cf90 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolIdentity.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolIdentity.cs
@@ -80,7 +80,7 @@ internal static DbConnectionPoolIdentity GetCurrent()
#endif
}
- #if NETFRAMEWORK
+ #if NETFRAMEWORK && _WINDOWS
internal static WindowsIdentity GetCurrentWindowsIdentity() =>
WindowsIdentity.GetCurrent();
#endif
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 f6eb1c84c1..a813a03003 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
@@ -8,7 +8,9 @@
#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/SqlDependency.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs
index e237e0e3e7..9ce5c20342 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs
@@ -20,7 +20,9 @@
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security.Permissions;
+#if _WINDOWS
using Interop.Windows.Sni;
+#endif
using Microsoft.Data.SqlClient.LocalDb;
#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlUtil.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlUtil.cs
index 7c7d3e8c87..9054f88ab7 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlUtil.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlUtil.cs
@@ -21,7 +21,9 @@
#if NETFRAMEWORK
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
+#if _WINDOWS
using Interop.Windows.Kernel32;
+#endif
#else
using System.Net.Sockets;
#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs
index 23063704ae..3f06a04ac6 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs
@@ -30,7 +30,9 @@
#if NETFRAMEWORK
using System.Runtime.CompilerServices;
+#if _WINDOWS
using Interop.Windows.Sni;
+#endif
using Microsoft.Data.SqlTypes;
#endif
diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec
index 1e8ea94d75..4792149ed2 100644
--- a/tools/specs/Microsoft.Data.SqlClient.nuspec
+++ b/tools/specs/Microsoft.Data.SqlClient.nuspec
@@ -86,20 +86,20 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -110,110 +110,105 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
diff --git a/tools/targets/CopySniDllsForNetFxProjectReferenceBuilds.targets b/tools/targets/CopySniDllsForNetFxProjectReferenceBuilds.targets
index e24a40cb01..47c45c41cd 100644
--- a/tools/targets/CopySniDllsForNetFxProjectReferenceBuilds.targets
+++ b/tools/targets/CopySniDllsForNetFxProjectReferenceBuilds.targets
@@ -34,15 +34,14 @@
Name="CopySniDllsForNetFx"
AfterTargets="CopyFilesToOutputDirectory"
Condition="'$(ReferenceType)' == 'Project' AND '$(TargetFramework)' == 'net462'">
-
-
-
- .NetFx
-
-
+
+
+
+
+
diff --git a/tools/targets/GenerateMdsPackage.targets b/tools/targets/GenerateMdsPackage.targets
index 1b3418860a..50f9b8fddd 100644
--- a/tools/targets/GenerateMdsPackage.targets
+++ b/tools/targets/GenerateMdsPackage.targets
@@ -1,11 +1,6 @@
-
- .NetFx
- .NetCore
-
-
@@ -14,6 +9,6 @@
-
+