diff --git a/BUILDGUIDE.md b/BUILDGUIDE.md
index 825af0c93a..6a094c698b 100644
--- a/BUILDGUIDE.md
+++ b/BUILDGUIDE.md
@@ -5,7 +5,6 @@ This document provides all the necessary details to build the driver and run tes
## Visual Studio Pre-Requisites
This project should be ideally built with Visual Studio 2017+ for the best compatibility. Use either of the two environments with their required set of compoenents as mentioned below:
-- **Visual Studio 2017** with imported components: [VS17Components](/tools/vsconfig/VS17Components.vsconfig)
- **Visual Studio 2019** with imported components: [VS19Components](/tools/vsconfig/VS19Components.vsconfig)
Once the environment is setup properly, execute the desired set of commands below from the _root_ folder to perform the respective operations:
@@ -115,6 +114,7 @@ Manual Tests require the below setup to run:
|SupportsLocalDb | (Optional) Whether or not a LocalDb instance of SQL Server is installed on the machine running the tests. |`true` OR `false`|
|SupportsIntegratedSecurity | (Optional) Whether or not the USER running tests has integrated security access to the target SQL Server.| `true` OR `false`|
|SupportsFileStream | (Optional) Whether or not FileStream is enabled on SQL Server| `true` OR `false`|
+|UseManagedSNIOnWindows | (Optional) Enables testing with Managed SNI on Windows| `true` OR `false`|
Commands to run tests:
@@ -140,7 +140,53 @@ Unix (`netcoreapp`):
## Run A Single Test
```bash
-> dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Debug" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "FullyQualifiedName=Microsoft.Data.SqlClient.ManualTesting.Tests.AlwaysEncrypted.CspProviderExt.TestKeysFromCertificatesCreatedWithMultipleCryptoProviders"
+> dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "FullyQualifiedName=Microsoft.Data.SqlClient.ManualTesting.Tests.AlwaysEncrypted.CspProviderExt.TestKeysFromCertificatesCreatedWithMultipleCryptoProviders"
+```
+
+## Testing with Custom ReferenceType
+
+Tests can be built and run with custom "Reference Type" property that enables different styles of testing:
+
+- "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 ***************
+> 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
+> ```
+
+### Building Tests:
+
+For .NET Core, all 4 reference types are supported:
+
+```bash
+> 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:
+
+```bash
+> msbuild /t:BuildTestsNetCore /p:ReferenceType=Project
+# Default setting uses Project Reference.
+
+> msbuild /t:BuildTestsNetCore /p:ReferenceType=Package
+```
+
+### Running Tests:
+
+Provide property to `dotnet test` commands for testing desired reference type.
+```
+dotnet test /p:ReferenceType=Project ...
```
## Testing with Custom TargetFramework
@@ -214,4 +260,3 @@ There may be times where connection cannot be made to SQL Server, we found below
false
true
```
- ```
diff --git a/RunTests.cmd b/RunTests.cmd
index 5e7cbfa1b9..20dbd88287 100644
--- a/RunTests.cmd
+++ b/RunTests.cmd
@@ -1,29 +1,203 @@
@echo off
-call :pauseOnError msbuild /p:Configuration="Release" /t:Clean,BuildAllConfigurations
-echo Building Add-Ons
+
+:: .NET CORE + .NET STANDARD LIBRARY TEST CASES
+echo Building .NET Core Tests
+call :pauseOnError msbuild /t:Clean
+
+:: ************** IMPORTANT NOTE BEFORE PROCEEDING WITH "PACKAGE" AND "NETSTANDARDPACKAGE" REFERENCE TYPES ***************
+:: 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
+
+:: REFERENCE TYPE "PACKAGE"
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildAKVNetFx /p:ReferenceType=Package
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildAKVNetCore /p:ReferenceType=Package
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package
+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=netcoreapp2.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore2.1-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=netcoreapp2.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore2.1-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:TargetNetCoreVersion=netcoreapp3.1
+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=netcoreapp3.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore3.1-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=netcoreapp3.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore3.1-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:TargetNetCoreVersion=netcoreapp5.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=netcoreapp5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.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=netcoreapp5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:Platform=x64
+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=netcoreapp2.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore2.1-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=netcoreapp2.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore2.1-manual-x64.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:Platform=x64 /p:TargetNetCoreVersion=netcoreapp3.1
+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=netcoreapp3.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore3.1-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=netcoreapp3.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore3.1-manual-x64.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:Platform=x64 /p:TargetNetCoreVersion=netcoreapp5.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=netcoreapp5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.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=netcoreapp5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-manual-x64.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:Platform=Win32
+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=netcoreapp2.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore2.1-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=netcoreapp2.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore2.1-manual-win32.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:Platform=Win32 /p:TargetNetCoreVersion=netcoreapp3.1
+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=netcoreapp3.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore3.1-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=netcoreapp3.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore3.1-manual-win32.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:Platform=Win32 /p:TargetNetCoreVersion=netcoreapp5.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=netcoreapp5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.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=netcoreapp5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-manual-win32.xml
+
+:: REFERENCE TYPE "NETSTANDARDPACKAGE"
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage
+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=netcoreapp2.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore2.1-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=netcoreapp2.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore2.1-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:TargetNetCoreVersion=netcoreapp3.1
+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=netcoreapp3.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore3.1-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=netcoreapp3.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore3.1-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:TargetNetCoreVersion=netcoreapp5.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=netcoreapp5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.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=netcoreapp5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:ReferenceType=NetStandardPackage /p:TargetNetFxVersion=net461
+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=net461 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net461-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=net461 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net461-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:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:Platform=x64
+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=netcoreapp2.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore2.1-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=netcoreapp2.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore2.1-manual-x64.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:Platform=x64 /p:TargetNetCoreVersion=netcoreapp3.1
+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=netcoreapp3.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore3.1-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=netcoreapp3.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore3.1-manual-x64.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:Platform=x64 /p:TargetNetCoreVersion=netcoreapp5.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=netcoreapp5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.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=netcoreapp5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-manual-x64.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:ReferenceType=NetStandardPackage /p:Platform=x64 /p:TargetNetFxVersion=net461
+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=net461 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net461-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=net461 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net461-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:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:Platform=Win32
+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=netcoreapp2.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore2.1-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=netcoreapp2.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore2.1-manual-win32.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:Platform=Win32 /p:TargetNetCoreVersion=netcoreapp3.1
+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=netcoreapp3.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore3.1-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=netcoreapp3.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore3.1-manual-win32.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:Platform=Win32 /p:TargetNetCoreVersion=netcoreapp5.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=netcoreapp5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.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=netcoreapp5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-manual-win32.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:ReferenceType=NetStandardPackage /p:Platform=Win32 /p:TargetNetFxVersion=net461
+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=net461 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net461-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=net461 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net461-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
+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=netcoreapp2.1 /p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore2.1-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=netcoreapp2.1 /p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore2.1-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandard /p:TargetNetCoreVersion=netcoreapp3.1
+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=netcoreapp3.1 /p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore3.1-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=netcoreapp3.1 /p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore3.1-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandard /p:TargetNetCoreVersion=netcoreapp5.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=netcoreapp5.0 /p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore5.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=netcoreapp5.0 /p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore5.0-manual-anycpu.xml
+
+:: TESTING 'NETSTANDARD' REFERENCE TYPE WITH .NET FRAMEWORK 4.6.1+ 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.
+
+:: REFERENCE TYPE "PROJECT" (We only build and test AnyCPU with Project Reference)
+call :pauseOnError msbuild /p:Configuration="Release"
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildAKVNetFx
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildAKVNetCoreAllOS
+call :pauseOnError msbuild /p:Configuration="Release" /t:GenerateAKVProviderNugetPackage
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore
+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=netcoreapp2.1 /p:ReferenceType=Project -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-netcore2.1-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=netcoreapp2.1 /p:ReferenceType=Project -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-netcore2.1-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:TargetNetCoreVersion=netcoreapp3.1
+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=netcoreapp3.1 /p:ReferenceType=Project -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-netcore3.1-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=netcoreapp3.1 /p:ReferenceType=Project -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-netcore3.1-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:TargetNetCoreVersion=netcoreapp5.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=netcoreapp5.0 /p:ReferenceType=Project -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-netcore5.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=netcoreapp5.0 /p:ReferenceType=Project -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-netcore5.0-manual-anycpu.xml
+
+:: .NET FRAMEWORK REFERENCE TYPE "PROJECT"
+echo Building .NET Framework Tests
+call :pauseOnError msbuild /p:Configuration="Release"
call :pauseOnError msbuild /p:Configuration="Release" /t:BuildAKVNetFx
call :pauseOnError msbuild /p:Configuration="Release" /t:BuildAKVNetCoreAllOS
-call :pauseOnError msbuild /p:configuration="Release" /t:GenerateAKVProviderNugetPackage
-echo Building tests (Net46 + NetCoreApp2.1)
+call :pauseOnError msbuild /p:Configuration="Release" /t:GenerateAKVProviderNugetPackage
call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx
-call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore
-echo Running SqlClient test suite (Net46 + NetCoreApp2.1)
-call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests"
-call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="Win32" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests"
-call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="x64" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests"
-call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests"
-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" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests"
-call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="x64" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests"
-echo Building tests (Net48 + NetCoreApp3.1)
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net46-functional-anycpu.xml
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net46-manual-anycpu.xml
+
call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:TargetNetFxVersion=net48
-call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:TargetNetCoreVersion=netcoreapp3.1
-echo Running SqlClient test suite (Net48 + NetCoreApp3.1)
-call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" /p:TargetNetCoreVersion=netcoreapp3.1 --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests"
-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"
-call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="x64" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" /p:TargetNetFxVersion=net48 --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests"
-call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" /p:TargetNetCoreVersion=netcoreapp3.1 --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests"
-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"
-call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="x64" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" /p:TargetNetFxVersion=net48 --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests"
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net48-functional-anycpu.xml
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net48-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:Platform=x64
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="x64" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net46-functional-x64.xml
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="x64" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net46-manual-x64.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:Platform=x64 /p:TargetNetFxVersion=net48
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="x64" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" /p:TargetNetFxVersion=net48 --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net48-functional-x64.xml
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="x64" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" /p:TargetNetFxVersion=net48 --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net48-manual-x64.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:Platform=Win32
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="Win32" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net46-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" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net46-manual-win32.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:Platform=Win32 /p:TargetNetFxVersion=net48
+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" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-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" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net48-manual-Win32.xml
+
+:: .NET FRAMEWORK REFERENCE TYPE "PACKAGE"
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:ReferenceType=Package
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net46-functional-anycpu.xml
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net46-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:TargetNetFxVersion=net48 /p:ReferenceType=Package
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net48-functional-anycpu.xml
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="AnyCPU" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net48-manual-anycpu.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:Platform=x64 /p:ReferenceType=Package
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="x64" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net46-functional-x64.xml
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="x64" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net46-manual-x64.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:Platform=x64 /p:TargetNetFxVersion=net48 /p:ReferenceType=Package
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="x64" /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-x64.xml
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Platform="x64" /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-x64.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:Platform=Win32 /p:ReferenceType=Package
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Platform="Win32" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net46-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" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net46-manual-win32.xml
+
+call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:Platform=Win32 /p:TargetNetFxVersion=net48 /p:ReferenceType=Package
+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
goto :eof
diff --git a/build.proj b/build.proj
index 526a3fda65..edebcec39e 100644
--- a/build.proj
+++ b/build.proj
@@ -1,6 +1,5 @@
-
-
+
+
@@ -22,18 +21,20 @@
-
-
-
+
+
+
+
-
+
+
@@ -47,23 +48,29 @@
-
-
+
+
+
+
+
+
+
+
-
+
@@ -76,45 +83,51 @@
-
-
+
+
+
+
-
-
+
+
+
+
-
-
+
-
+
+
-
+
-
+
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
+
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index f20e408967..c56d604473 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -9,6 +9,19 @@
true
true
true
+
+ Project
$(DefineConstants);DEBUG
@@ -16,27 +29,24 @@
$(MSBuildThisFileDirectory)
$(ProjectDir)..\
+ $(RepoRoot)artifacts\$(ReferenceType)\
$(ProjectDir)Microsoft.Data.SqlClient\
$(ManagedSourceCode)netcore\
$(ManagedSourceCode)netfx\
$(ManagedSourceCode)netfx\src\Resources\
- $(RepoRoot)obj\
+ $(ManagedSourceCode)add-ons\
+ $(Artifacts)obj\
$(NetCoreSource)src\Common\src
$(NetCoreSource)src\Common\tests
$(ProjectDir)Microsoft.Data.SqlClient\tests\
- $(RepoRoot)bin\Windows_NT\
- $(RepoRoot)bin\AnyOS\
- $(RepoRoot)bin\Unix\
+ $(Artifacts)bin\Windows_NT\
+ $(Artifacts)bin\AnyOS\
+ $(Artifacts)bin\Unix\
$(RepoRoot)tools\
$(RepoRoot)packages\
$(RepoRoot).nuget\
$(NuGetRoot)nuget.exe
- $(DOTNET_INSTALL_DIR)
- $(RepoRoot).dotnet\
- $(DotNetRoot)\
- $(DotNetRoot)dotnet
- $(DotNetCmd).exe
true
false
diff --git a/src/Microsoft.Data.SqlClient.sln b/src/Microsoft.Data.SqlClient.sln
index 63597ed179..9077063825 100644
--- a/src/Microsoft.Data.SqlClient.sln
+++ b/src/Microsoft.Data.SqlClient.sln
@@ -1,4 +1,3 @@
-
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29521.150
@@ -171,6 +170,8 @@ Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-co
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.SqlClient.DockerLinuxTest", "Microsoft.Data.SqlClient\tests\DockerLinuxTest\Microsoft.Data.SqlClient.DockerLinuxTest.csproj", "{833157E1-1E53-4908-B4CB-5C5507A44582}"
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}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -1035,6 +1036,54 @@ Global
{833157E1-1E53-4908-B4CB-5C5507A44582}.Release|x64.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Release|x86.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.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}.net46-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.net46-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.net46-Debug|x64.ActiveCfg = Debug|x64
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.net46-Debug|x64.Build.0 = Debug|x64
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.net46-Debug|x86.ActiveCfg = Debug|x86
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.net46-Debug|x86.Build.0 = Debug|x86
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.net46-Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.net46-Release|Any CPU.Build.0 = Release|Any CPU
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.net46-Release|x64.ActiveCfg = Release|x64
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.net46-Release|x64.Build.0 = Release|x64
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.net46-Release|x86.ActiveCfg = Release|x86
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.net46-Release|x86.Build.0 = Release|x86
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp2.1-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp2.1-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp2.1-Debug|x64.ActiveCfg = Debug|x64
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp2.1-Debug|x64.Build.0 = Debug|x64
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp2.1-Debug|x86.ActiveCfg = Debug|x86
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp2.1-Debug|x86.Build.0 = Debug|x86
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp2.1-Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp2.1-Release|Any CPU.Build.0 = Release|Any CPU
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp2.1-Release|x64.ActiveCfg = Release|x64
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp2.1-Release|x64.Build.0 = Release|x64
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp2.1-Release|x86.ActiveCfg = Release|x86
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp2.1-Release|x86.Build.0 = Release|x86
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp3.1-Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp3.1-Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp3.1-Debug|x64.ActiveCfg = Debug|x64
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp3.1-Debug|x64.Build.0 = Debug|x64
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp3.1-Debug|x86.ActiveCfg = Debug|x86
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp3.1-Debug|x86.Build.0 = Debug|x86
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp3.1-Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp3.1-Release|Any CPU.Build.0 = Release|Any CPU
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp3.1-Release|x64.ActiveCfg = Release|x64
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp3.1-Release|x64.Build.0 = Release|x64
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp3.1-Release|x86.ActiveCfg = Release|x86
+ {E7336BFB-8521-423A-A140-3123F9065C5D}.netcoreapp3.1-Release|x86.Build.0 = Release|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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1066,6 +1115,7 @@ Global
{650EB7FA-EB0D-4F8E-AB2C-161C3AD8E363} = {71F356DC-DFA3-4163-8BFE-D268722CE189}
{5A7600BD-AED8-44AB-8F2A-7CB33A8D9C02} = {71F356DC-DFA3-4163-8BFE-D268722CE189}
{833157E1-1E53-4908-B4CB-5C5507A44582} = {0CC4817A-12F3-4357-912C-09315FAAD008}
+ {E7336BFB-8521-423A-A140-3123F9065C5D} = {0CC4817A-12F3-4357-912C-09315FAAD008}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {01D48116-37A2-4D33-B9EC-94793C702431}
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 9647acbf7f..9a32df9809 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
@@ -4,8 +4,8 @@
Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider
AzureKeyVaultProvider
{9073ABEF-92E0-4702-BB23-2C99CEF9BDD7}
- netcoreapp
- netfx
+ netcoreapp
+ netfx
Debug;Release;net46-Release;net46-Debug;netcoreapp2.1-Debug;netcoreapp2.1-Release;
AnyCPU;x86;x64
$(ObjFolder)$(Configuration).$(Platform)\$(AddOnName)
@@ -17,8 +17,9 @@
true
-
-
+
+
+
diff --git a/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props b/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props
index 7469e3d558..4fc891665f 100644
--- a/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props
+++ b/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props
@@ -3,6 +3,11 @@
+
+
+ Project
+
+
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Interop/SNINativeMethodWrapper.Windows.cs b/src/Microsoft.Data.SqlClient/netcore/src/Interop/SNINativeMethodWrapper.Windows.cs
index 6e34dbf975..1296e4afa3 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Interop/SNINativeMethodWrapper.Windows.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Interop/SNINativeMethodWrapper.Windows.cs
@@ -11,7 +11,7 @@ namespace Microsoft.Data.SqlClient
{
internal static partial class SNINativeMethodWrapper
{
- private const string SNI = "sni.dll";
+ private const string SNI = "Microsoft.Data.SqlClient.SNI.dll";
private static int s_sniMaxComposedSpnLength = -1;
@@ -245,7 +245,7 @@ internal struct SNI_Error
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
private static extern uint SNIOpenWrapper(
[In] ref Sni_Consumer_Info pConsumerInfo,
- [MarshalAs(UnmanagedType.LPStr)] string szConnect,
+ [MarshalAs(UnmanagedType.LPWStr)] string szConnect,
[In] SNIHandle pConn,
out IntPtr ppConn,
[MarshalAs(UnmanagedType.Bool)] bool fSync);
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 d1ddbf37af..01c6206a92 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
@@ -665,7 +665,7 @@
-
+
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 1425d80c32..4d5f63e325 100644
--- a/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj
@@ -1,7 +1,7 @@
false
- net46
+ net46
$(ObjFolder)$(Configuration)\$(AssemblyName)\ref\
$(BinFolder)$(Configuration)\$(AssemblyName)\ref\
$(OutputPath)\Microsoft.Data.SqlClient.xml
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 8a6ad37876..adc1a2b62c 100644
--- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj
@@ -82,19 +82,16 @@
-
-
-
Microsoft\Data\SqlClient\SqlClientEventSource.cs
-
+
Microsoft\Data\SqlClient\SqlClientLogger.cs
- >Microsoft\Data\Common\ActivityCorrelator.cs
+ Microsoft\Data\Common\ActivityCorrelator.cs
Microsoft\Data\Sql\SqlNotificationRequest.cs
@@ -123,7 +120,7 @@
Microsoft\Data\SqlClient\ColumnEncryptionKeyInfo.cs
-
+
Microsoft\Data\SqlClient\OnChangedEventHandler.cs
@@ -197,6 +194,8 @@
+
+
@@ -422,6 +421,8 @@
$(MicrosoftDataSqlClientSniVersion)
+ All
+ runtime; build; native; contentfiles; analyzers; buildtransitive
$(MicrosoftIdentityClientVersion)
diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Interop/SNINativeManagedWrapperX64.cs b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Interop/SNINativeManagedWrapperX64.cs
new file mode 100644
index 0000000000..dd585ededa
--- /dev/null
+++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Interop/SNINativeManagedWrapperX64.cs
@@ -0,0 +1,126 @@
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+using static Microsoft.Data.SqlClient.SNINativeMethodWrapper;
+
+namespace Microsoft.Data.SqlClient
+{
+ internal static class SNINativeManagedWrapperX64
+ {
+ private const string SNI = "Microsoft.Data.SqlClient.SNI.x64.dll";
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")]
+ internal static extern uint SNIAddProvider(SNIHandle pConn, ProviderEnum ProvNum, [In] ref uint pInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")]
+ internal static extern uint SNIAddProviderWrapper(SNIHandle pConn, ProviderEnum ProvNum, [In] ref SNICTAIPProviderInfo pInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")]
+ internal static extern uint SNIAddProviderWrapper(SNIHandle pConn, ProviderEnum ProvNum, [In] ref AuthProviderInfo pInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNICheckConnectionWrapper")]
+ internal static extern uint SNICheckConnection([In] SNIHandle pConn);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNICloseWrapper")]
+ internal static extern uint SNIClose(IntPtr pConn);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern void SNIGetLastError(out SNI_Error pErrorStruct);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern void SNIPacketRelease(IntPtr pPacket);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIPacketResetWrapper")]
+ internal static extern void SNIPacketReset([In] SNIHandle pConn, IOType IOType, SNIPacket pPacket, ConsumerNumber ConsNum);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIQueryInfo(QTypes QType, ref uint pbQInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIQueryInfo(QTypes QType, ref IntPtr pbQInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIReadAsyncWrapper")]
+ internal static extern uint SNIReadAsync(SNIHandle pConn, ref IntPtr ppNewPacket);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIReadSyncOverAsync(SNIHandle pConn, ref IntPtr ppNewPacket, int timeout);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIRemoveProviderWrapper")]
+ internal static extern uint SNIRemoveProvider(SNIHandle pConn, ProviderEnum ProvNum);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNISecInitPackage(ref uint pcbMaxToken);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNISetInfoWrapper")]
+ internal static extern uint SNISetInfo(SNIHandle pConn, QTypes QType, [In] ref uint pbQInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNITerminate();
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIWaitForSSLHandshakeToCompleteWrapper")]
+ internal static extern uint SNIWaitForSSLHandshakeToComplete([In] SNIHandle pConn, int dwMilliseconds);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint UnmanagedIsTokenRestricted([In] IntPtr token, [MarshalAs(UnmanagedType.Bool)] out bool isRestricted);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint GetSniMaxComposedSpnLength();
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, out Guid pbQInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, [MarshalAs(UnmanagedType.Bool)] out bool pbQInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, ref IntPtr pbQInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIInitialize")]
+ internal static extern uint SNIInitialize([In] IntPtr pmo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIOpenSyncExWrapper(ref SNI_CLIENT_CONSUMER_INFO pClientConsumerInfo, out IntPtr ppConn);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIOpenWrapper(
+ [In] ref Sni_Consumer_Info pConsumerInfo,
+ [MarshalAs(UnmanagedType.LPWStr)] string szConnect,
+ [In] SNIHandle pConn,
+ out IntPtr ppConn,
+ [MarshalAs(UnmanagedType.Bool)] bool fSync);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern IntPtr SNIPacketAllocateWrapper([In] SafeHandle pConn, IOType IOType);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIPacketGetDataWrapper([In] IntPtr packet, [In, Out] byte[] readBuffer, uint readBufferLength, out uint dataSize);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern unsafe void SNIPacketSetData(SNIPacket pPacket, [In] byte* pbBuf, uint cbBuf);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNISecGenClientContextWrapper")]
+ internal static extern unsafe uint SNISecGenClientContextWrapper(
+ [In] SNIHandle pConn,
+ [In, Out] byte[] pIn,
+ uint cbIn,
+ [In, Out] byte[] pOut,
+ [In] ref uint pcbOut,
+ [MarshalAsAttribute(UnmanagedType.Bool)] out bool pfDone,
+ byte* szServerInfo,
+ uint cbServerInfo,
+ [MarshalAsAttribute(UnmanagedType.LPWStr)] string pwszUserName,
+ [MarshalAsAttribute(UnmanagedType.LPWStr)] string pwszPassword);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIWriteAsyncWrapper(SNIHandle pConn, [In] SNIPacket pPacket);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIWriteSyncOverAsync(SNIHandle pConn, [In] SNIPacket pPacket);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern IntPtr SNIClientCertificateFallbackWrapper(IntPtr pCallbackContext);
+ }
+}
diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Interop/SNINativeManagedWrapperX86.cs b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Interop/SNINativeManagedWrapperX86.cs
new file mode 100644
index 0000000000..339760c1a2
--- /dev/null
+++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Interop/SNINativeManagedWrapperX86.cs
@@ -0,0 +1,126 @@
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+using static Microsoft.Data.SqlClient.SNINativeMethodWrapper;
+
+namespace Microsoft.Data.SqlClient
+{
+ internal static class SNINativeManagedWrapperX86
+ {
+ private const string SNI = "Microsoft.Data.SqlClient.SNI.x86.dll";
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")]
+ internal static extern uint SNIAddProvider(SNIHandle pConn, ProviderEnum ProvNum, [In] ref uint pInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")]
+ internal static extern uint SNIAddProviderWrapper(SNIHandle pConn, ProviderEnum ProvNum, [In] ref SNICTAIPProviderInfo pInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")]
+ internal static extern uint SNIAddProviderWrapper(SNIHandle pConn, ProviderEnum ProvNum, [In] ref AuthProviderInfo pInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNICheckConnectionWrapper")]
+ internal static extern uint SNICheckConnection([In] SNIHandle pConn);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNICloseWrapper")]
+ internal static extern uint SNIClose(IntPtr pConn);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern void SNIGetLastError(out SNI_Error pErrorStruct);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern void SNIPacketRelease(IntPtr pPacket);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIPacketResetWrapper")]
+ internal static extern void SNIPacketReset([In] SNIHandle pConn, IOType IOType, SNIPacket pPacket, ConsumerNumber ConsNum);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIQueryInfo(QTypes QType, ref uint pbQInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIQueryInfo(QTypes QType, ref IntPtr pbQInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIReadAsyncWrapper")]
+ internal static extern uint SNIReadAsync(SNIHandle pConn, ref IntPtr ppNewPacket);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIReadSyncOverAsync(SNIHandle pConn, ref IntPtr ppNewPacket, int timeout);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIRemoveProviderWrapper")]
+ internal static extern uint SNIRemoveProvider(SNIHandle pConn, ProviderEnum ProvNum);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNISecInitPackage(ref uint pcbMaxToken);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNISetInfoWrapper")]
+ internal static extern uint SNISetInfo(SNIHandle pConn, QTypes QType, [In] ref uint pbQInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNITerminate();
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIWaitForSSLHandshakeToCompleteWrapper")]
+ internal static extern uint SNIWaitForSSLHandshakeToComplete([In] SNIHandle pConn, int dwMilliseconds);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint UnmanagedIsTokenRestricted([In] IntPtr token, [MarshalAs(UnmanagedType.Bool)] out bool isRestricted);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint GetSniMaxComposedSpnLength();
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, out Guid pbQInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, [MarshalAs(UnmanagedType.Bool)] out bool pbQInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, ref IntPtr pbQInfo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIInitialize")]
+ internal static extern uint SNIInitialize([In] IntPtr pmo);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIOpenSyncExWrapper(ref SNI_CLIENT_CONSUMER_INFO pClientConsumerInfo, out IntPtr ppConn);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIOpenWrapper(
+ [In] ref Sni_Consumer_Info pConsumerInfo,
+ [MarshalAs(UnmanagedType.LPWStr)] string szConnect,
+ [In] SNIHandle pConn,
+ out IntPtr ppConn,
+ [MarshalAs(UnmanagedType.Bool)] bool fSync);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern IntPtr SNIPacketAllocateWrapper([In] SafeHandle pConn, IOType IOType);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIPacketGetDataWrapper([In] IntPtr packet, [In, Out] byte[] readBuffer, uint readBufferLength, out uint dataSize);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern unsafe void SNIPacketSetData(SNIPacket pPacket, [In] byte* pbBuf, uint cbBuf);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNISecGenClientContextWrapper")]
+ internal static extern unsafe uint SNISecGenClientContextWrapper(
+ [In] SNIHandle pConn,
+ [In, Out] byte[] pIn,
+ uint cbIn,
+ [In, Out] byte[] pOut,
+ [In] ref uint pcbOut,
+ [MarshalAsAttribute(UnmanagedType.Bool)] out bool pfDone,
+ byte* szServerInfo,
+ uint cbServerInfo,
+ [MarshalAsAttribute(UnmanagedType.LPWStr)] string pwszUserName,
+ [MarshalAsAttribute(UnmanagedType.LPWStr)] string pwszPassword);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIWriteAsyncWrapper(SNIHandle pConn, [In] SNIPacket pPacket);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern uint SNIWriteSyncOverAsync(SNIHandle pConn, [In] SNIPacket pPacket);
+
+ [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
+ internal static extern IntPtr SNIClientCertificateFallbackWrapper(IntPtr pCallbackContext);
+ }
+}
diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Interop/SNINativeMethodWrapper.cs b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Interop/SNINativeMethodWrapper.cs
index 5a724ec716..499b29b4d3 100644
--- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Interop/SNINativeMethodWrapper.cs
+++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Interop/SNINativeMethodWrapper.cs
@@ -18,9 +18,8 @@ namespace Microsoft.Data.SqlClient
{
internal static class SNINativeMethodWrapper
{
- private const string SNI = "SNI.dll";
-
private static int s_sniMaxComposedSpnLength = -1;
+ private static readonly bool s_is64bitProcess = Environment.Is64BitProcess;
private const int SniOpenTimeOut = -1; // infinite
@@ -52,20 +51,6 @@ internal static class SNINativeMethodWrapper
internal const int LocalDBFailedToLoadDll = 56;
internal const int LocalDBBadRuntime = 57;
- static SNINativeMethodWrapper()
- {
- var localPath = new Uri(typeof(SNINativeMethodWrapper).Assembly.CodeBase).LocalPath;
- var localFolder = Path.GetDirectoryName(localPath);
- var subfolder = Environment.Is64BitProcess ? "\\x64\\" : "\\x86\\";
-
- IntPtr pDll = LoadLibrary(localFolder + subfolder + SNI);
- if (pDll == IntPtr.Zero)
- {
- throw new System.ComponentModel.Win32Exception("Failed to load " + localFolder + subfolder + SNI,
- new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error()));
- }
- }
-
internal static int SniMaxComposedSpnLength
{
get
@@ -333,7 +318,7 @@ internal enum TransparentNetworkResolutionMode : byte
};
[StructLayout(LayoutKind.Sequential)]
- private struct Sni_Consumer_Info
+ internal struct Sni_Consumer_Info
{
public int DefaultUserDataLength;
public IntPtr ConsumerKey;
@@ -347,7 +332,7 @@ private struct Sni_Consumer_Info
}
[StructLayout(LayoutKind.Sequential)]
- private unsafe struct SNI_CLIENT_CONSUMER_INFO
+ internal unsafe struct SNI_CLIENT_CONSUMER_INFO
{
public Sni_Consumer_Info ConsumerInfo;
[MarshalAs(UnmanagedType.LPWStr)]
@@ -393,97 +378,228 @@ internal struct SNI_Error
[DllImport("secur32.dll", ExactSpelling = true, SetLastError = true)]
internal static extern uint QueryContextAttributes(ref CredHandle contextHandle, [In] ContextAttribute attribute, [In] IntPtr buffer);
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")]
- internal static extern uint SNIAddProvider(SNIHandle pConn, ProviderEnum ProvNum, [In] ref uint pInfo);
+ internal static uint SNIAddProvider(SNIHandle pConn, ProviderEnum ProvNum, [In] ref uint pInfo)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIAddProvider(pConn, ProvNum, ref pInfo) :
+ SNINativeManagedWrapperX86.SNIAddProvider(pConn, ProvNum, ref pInfo);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")]
- internal static extern uint SNIAddProviderWrapper(SNIHandle pConn, ProviderEnum ProvNum, [In] ref SNICTAIPProviderInfo pInfo);
+ internal static uint SNIAddProviderWrapper(SNIHandle pConn, ProviderEnum ProvNum, [In] ref SNICTAIPProviderInfo pInfo)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIAddProviderWrapper(pConn, ProvNum, ref pInfo) :
+ SNINativeManagedWrapperX86.SNIAddProviderWrapper(pConn, ProvNum, ref pInfo);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")]
- internal static extern uint SNIAddProviderWrapper(SNIHandle pConn, ProviderEnum ProvNum, [In] ref AuthProviderInfo pInfo);
+ internal static uint SNIAddProviderWrapper(SNIHandle pConn, ProviderEnum ProvNum, [In] ref AuthProviderInfo pInfo)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIAddProviderWrapper(pConn, ProvNum, ref pInfo) :
+ SNINativeManagedWrapperX86.SNIAddProviderWrapper(pConn, ProvNum, ref pInfo);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNICheckConnectionWrapper")]
- internal static extern uint SNICheckConnection([In] SNIHandle pConn);
+ internal static uint SNICheckConnection([In] SNIHandle pConn)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNICheckConnection(pConn) :
+ SNINativeManagedWrapperX86.SNICheckConnection(pConn);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNICloseWrapper")]
- internal static extern uint SNIClose(IntPtr pConn);
+ internal static uint SNIClose(IntPtr pConn)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIClose(pConn) :
+ SNINativeManagedWrapperX86.SNIClose(pConn);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SNIGetLastError(out SNI_Error pErrorStruct);
+ internal static void SNIGetLastError(out SNI_Error pErrorStruct)
+ {
+ if (s_is64bitProcess)
+ {
+ SNINativeManagedWrapperX64.SNIGetLastError(out pErrorStruct);
+ }
+ else
+ {
+ SNINativeManagedWrapperX86.SNIGetLastError(out pErrorStruct);
+ }
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void SNIPacketRelease(IntPtr pPacket);
+ internal static void SNIPacketRelease(IntPtr pPacket)
+ {
+ if (s_is64bitProcess)
+ {
+ SNINativeManagedWrapperX64.SNIPacketRelease(pPacket);
+ }
+ else
+ {
+ SNINativeManagedWrapperX86.SNIPacketRelease(pPacket);
+ }
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIPacketResetWrapper")]
- internal static extern void SNIPacketReset([In] SNIHandle pConn, IOType IOType, SNIPacket pPacket, ConsumerNumber ConsNum);
+ internal static void SNIPacketReset([In] SNIHandle pConn, IOType IOType, SNIPacket pPacket, ConsumerNumber ConsNum)
+ {
+ if (s_is64bitProcess)
+ {
+ SNINativeManagedWrapperX64.SNIPacketReset(pConn, IOType, pPacket, ConsNum);
+ }
+ else
+ {
+ SNINativeManagedWrapperX86.SNIPacketReset(pConn, IOType, pPacket, ConsNum);
+ }
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint SNIQueryInfo(QTypes QType, ref uint pbQInfo);
+ internal static uint SNIQueryInfo(QTypes QType, ref uint pbQInfo)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIQueryInfo(QType, ref pbQInfo) :
+ SNINativeManagedWrapperX86.SNIQueryInfo(QType, ref pbQInfo);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint SNIQueryInfo(QTypes QType, ref IntPtr pbQInfo);
+ internal static uint SNIQueryInfo(QTypes QType, ref IntPtr pbQInfo)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIQueryInfo(QType, ref pbQInfo) :
+ SNINativeManagedWrapperX86.SNIQueryInfo(QType, ref pbQInfo);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIReadAsyncWrapper")]
- internal static extern uint SNIReadAsync(SNIHandle pConn, ref IntPtr ppNewPacket);
+ internal static uint SNIReadAsync(SNIHandle pConn, ref IntPtr ppNewPacket)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIReadAsync(pConn, ref ppNewPacket) :
+ SNINativeManagedWrapperX86.SNIReadAsync(pConn, ref ppNewPacket);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint SNIReadSyncOverAsync(SNIHandle pConn, ref IntPtr ppNewPacket, int timeout);
+ internal static uint SNIReadSyncOverAsync(SNIHandle pConn, ref IntPtr ppNewPacket, int timeout)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIReadSyncOverAsync(pConn, ref ppNewPacket, timeout) :
+ SNINativeManagedWrapperX86.SNIReadSyncOverAsync(pConn, ref ppNewPacket, timeout);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIRemoveProviderWrapper")]
- internal static extern uint SNIRemoveProvider(SNIHandle pConn, ProviderEnum ProvNum);
+ internal static uint SNIRemoveProvider(SNIHandle pConn, ProviderEnum ProvNum)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIRemoveProvider(pConn, ProvNum) :
+ SNINativeManagedWrapperX86.SNIRemoveProvider(pConn, ProvNum);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint SNISecInitPackage(ref uint pcbMaxToken);
+ internal static uint SNISecInitPackage(ref uint pcbMaxToken)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNISecInitPackage(ref pcbMaxToken) :
+ SNINativeManagedWrapperX86.SNISecInitPackage(ref pcbMaxToken);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNISetInfoWrapper")]
- internal static extern uint SNISetInfo(SNIHandle pConn, QTypes QType, [In] ref uint pbQInfo);
+ internal static uint SNISetInfo(SNIHandle pConn, QTypes QType, [In] ref uint pbQInfo)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNISetInfo(pConn, QType, ref pbQInfo) :
+ SNINativeManagedWrapperX86.SNISetInfo(pConn, QType, ref pbQInfo);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint SNITerminate();
+ internal static uint SNITerminate()
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNITerminate() :
+ SNINativeManagedWrapperX86.SNITerminate();
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIWaitForSSLHandshakeToCompleteWrapper")]
- internal static extern uint SNIWaitForSSLHandshakeToComplete([In] SNIHandle pConn, int dwMilliseconds);
+ internal static uint SNIWaitForSSLHandshakeToComplete([In] SNIHandle pConn, int dwMilliseconds)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIWaitForSSLHandshakeToComplete(pConn, dwMilliseconds) :
+ SNINativeManagedWrapperX86.SNIWaitForSSLHandshakeToComplete(pConn, dwMilliseconds);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint UnmanagedIsTokenRestricted([In] IntPtr token, [MarshalAs(UnmanagedType.Bool)] out bool isRestricted);
+ internal static uint UnmanagedIsTokenRestricted([In] IntPtr token, [MarshalAs(UnmanagedType.Bool)] out bool isRestricted)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.UnmanagedIsTokenRestricted(token, out isRestricted) :
+ SNINativeManagedWrapperX86.UnmanagedIsTokenRestricted(token, out isRestricted);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern uint GetSniMaxComposedSpnLength();
+ private static uint GetSniMaxComposedSpnLength()
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.GetSniMaxComposedSpnLength() :
+ SNINativeManagedWrapperX86.GetSniMaxComposedSpnLength();
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, out Guid pbQInfo);
+ private static uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, out Guid pbQInfo)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIGetInfoWrapper(pConn, QType, out pbQInfo) :
+ SNINativeManagedWrapperX86.SNIGetInfoWrapper(pConn, QType, out pbQInfo);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, [MarshalAs(UnmanagedType.Bool)] out bool pbQInfo);
+ private static uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, [MarshalAs(UnmanagedType.Bool)] out bool pbQInfo)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIGetInfoWrapper(pConn, QType, out pbQInfo) :
+ SNINativeManagedWrapperX86.SNIGetInfoWrapper(pConn, QType, out pbQInfo);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, ref IntPtr pbQInfo);
+ private static uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, ref IntPtr pbQInfo)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIGetInfoWrapper(pConn, QType, ref pbQInfo) :
+ SNINativeManagedWrapperX86.SNIGetInfoWrapper(pConn, QType, ref pbQInfo);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIInitialize")]
- private static extern uint SNIInitialize([In] IntPtr pmo);
+ private static uint SNIInitialize([In] IntPtr pmo)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIInitialize(pmo) :
+ SNINativeManagedWrapperX86.SNIInitialize(pmo);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern uint SNIOpenSyncExWrapper(ref SNI_CLIENT_CONSUMER_INFO pClientConsumerInfo, out IntPtr ppConn);
+ private static uint SNIOpenSyncExWrapper(ref SNI_CLIENT_CONSUMER_INFO pClientConsumerInfo, out IntPtr ppConn)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIOpenSyncExWrapper(ref pClientConsumerInfo, out ppConn) :
+ SNINativeManagedWrapperX86.SNIOpenSyncExWrapper(ref pClientConsumerInfo, out ppConn);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern uint SNIOpenWrapper(
+ private static uint SNIOpenWrapper(
[In] ref Sni_Consumer_Info pConsumerInfo,
[MarshalAs(UnmanagedType.LPWStr)] string szConnect,
[In] SNIHandle pConn,
out IntPtr ppConn,
- [MarshalAs(UnmanagedType.Bool)] bool fSync);
+ [MarshalAs(UnmanagedType.Bool)] bool fSync)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIOpenWrapper(ref pConsumerInfo, szConnect, pConn, out ppConn, fSync) :
+ SNINativeManagedWrapperX86.SNIOpenWrapper(ref pConsumerInfo, szConnect, pConn, out ppConn, fSync);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern IntPtr SNIPacketAllocateWrapper([In] SafeHandle pConn, IOType IOType);
+ private static IntPtr SNIPacketAllocateWrapper([In] SafeHandle pConn, IOType IOType)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIPacketAllocateWrapper(pConn, IOType) :
+ SNINativeManagedWrapperX86.SNIPacketAllocateWrapper(pConn, IOType);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern uint SNIPacketGetDataWrapper([In] IntPtr packet, [In, Out] byte[] readBuffer, uint readBufferLength, out uint dataSize);
+ private static uint SNIPacketGetDataWrapper([In] IntPtr packet, [In, Out] byte[] readBuffer, uint readBufferLength, out uint dataSize)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIPacketGetDataWrapper(packet, readBuffer, readBufferLength, out dataSize) :
+ SNINativeManagedWrapperX86.SNIPacketGetDataWrapper(packet, readBuffer, readBufferLength, out dataSize);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern unsafe void SNIPacketSetData(SNIPacket pPacket, [In] byte* pbBuf, uint cbBuf);
+ private static unsafe void SNIPacketSetData(SNIPacket pPacket, [In] byte* pbBuf, uint cbBuf)
+ {
+ if (s_is64bitProcess)
+ {
+ SNINativeManagedWrapperX64.SNIPacketSetData(pPacket, pbBuf, cbBuf);
+ }
+ else
+ {
+ SNINativeManagedWrapperX86.SNIPacketSetData(pPacket, pbBuf, cbBuf);
+ }
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNISecGenClientContextWrapper")]
- private static extern unsafe uint SNISecGenClientContextWrapper(
+ private static unsafe uint SNISecGenClientContextWrapper(
[In] SNIHandle pConn,
[In, Out] byte[] pIn,
uint cbIn,
@@ -493,16 +609,33 @@ private static extern unsafe uint SNISecGenClientContextWrapper(
byte* szServerInfo,
uint cbServerInfo,
[MarshalAsAttribute(UnmanagedType.LPWStr)] string pwszUserName,
- [MarshalAsAttribute(UnmanagedType.LPWStr)] string pwszPassword);
+ [MarshalAsAttribute(UnmanagedType.LPWStr)] string pwszPassword)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNISecGenClientContextWrapper(pConn, pIn, cbIn, pOut, ref pcbOut, out pfDone, szServerInfo, cbServerInfo, pwszUserName, pwszPassword) :
+ SNINativeManagedWrapperX86.SNISecGenClientContextWrapper(pConn, pIn, cbIn, pOut, ref pcbOut, out pfDone, szServerInfo, cbServerInfo, pwszUserName, pwszPassword);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern uint SNIWriteAsyncWrapper(SNIHandle pConn, [In] SNIPacket pPacket);
+ private static uint SNIWriteAsyncWrapper(SNIHandle pConn, [In] SNIPacket pPacket)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIWriteAsyncWrapper(pConn, pPacket) :
+ SNINativeManagedWrapperX86.SNIWriteAsyncWrapper(pConn, pPacket);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern uint SNIWriteSyncOverAsync(SNIHandle pConn, [In] SNIPacket pPacket);
+ private static uint SNIWriteSyncOverAsync(SNIHandle pConn, [In] SNIPacket pPacket)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIWriteSyncOverAsync(pConn, pPacket) :
+ SNINativeManagedWrapperX86.SNIWriteSyncOverAsync(pConn, pPacket);
+ }
- [DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern IntPtr SNIClientCertificateFallbackWrapper(IntPtr pCallbackContext);
+ private static IntPtr SNIClientCertificateFallbackWrapper(IntPtr pCallbackContext)
+ {
+ return s_is64bitProcess ?
+ SNINativeManagedWrapperX64.SNIClientCertificateFallbackWrapper(pCallbackContext) :
+ SNINativeManagedWrapperX86.SNIClientCertificateFallbackWrapper(pCallbackContext);
+ }
#endregion
internal static uint SNISecGetServerCertificate(SNIHandle pConnectionObject, ref X509Certificate2 certificate)
diff --git a/src/Microsoft.Data.SqlClient/tests/Directory.Build.props b/src/Microsoft.Data.SqlClient/tests/Directory.Build.props
index 30fa92fe03..5d26340cf8 100644
--- a/src/Microsoft.Data.SqlClient/tests/Directory.Build.props
+++ b/src/Microsoft.Data.SqlClient/tests/Directory.Build.props
@@ -8,6 +8,7 @@
net46
netcoreapp2.1
+ Project
diff --git a/src/Microsoft.Data.SqlClient/tests/DockerLinuxTest/Microsoft.Data.SqlClient.DockerLinuxTest.csproj b/src/Microsoft.Data.SqlClient/tests/DockerLinuxTest/Microsoft.Data.SqlClient.DockerLinuxTest.csproj
index 7d3ecb246c..1a452df62f 100644
--- a/src/Microsoft.Data.SqlClient/tests/DockerLinuxTest/Microsoft.Data.SqlClient.DockerLinuxTest.csproj
+++ b/src/Microsoft.Data.SqlClient/tests/DockerLinuxTest/Microsoft.Data.SqlClient.DockerLinuxTest.csproj
@@ -10,6 +10,6 @@
-
+
diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/ExceptionsAlgorithmErrors.cs b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/ExceptionsAlgorithmErrors.cs
index cbb1ac8bb4..c273534045 100644
--- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/ExceptionsAlgorithmErrors.cs
+++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/ExceptionsAlgorithmErrors.cs
@@ -103,11 +103,10 @@ public void TestInvalidAuthenticationTag()
}
[Fact]
- [ActiveIssue(9658)]
[PlatformSpecific(TestPlatforms.Windows)]
public void TestNullColumnEncryptionAlgorithm()
{
- string expectedMessage = "Internal error. Encryption algorithm cannot be null. Valid algorithms are: 'AES_256_CBC', 'AEAD_AES_256_CBC_HMAC_SHA256'.\r\nParameter name: encryptionAlgorithm";
+ string expectedMessage = "Internal error. Encryption algorithm cannot be null.";
Object cipherMD = Utility.GetSqlCipherMetadata(0, 0, null, 1, 0x01);
Utility.AddEncryptionKeyToCipherMD(cipherMD, CertFixture.encryptedCek, 0, 0, 0, new byte[] { 0x01, 0x02, 0x03 }, CertFixture.certificatePath, "MSSQL_CERTIFICATE_STORE", "RSA_OAEP");
byte[] plainText = Encoding.Unicode.GetBytes("HelloWorld");
@@ -140,35 +139,34 @@ public void TestUnknownEncryptionAlgorithmId()
[PlatformSpecific(TestPlatforms.Windows)]
public void TestUnknownCustomKeyStoreProvider()
{
- string errorMessage = "Failed to decrypt a column encryption key. Invalid key store provider name: 'Dummy_Provider'. A key store provider name must denote either a system key store provider or a registered custom key store provider. Valid system key store provider names are: 'MSSQL_CERTIFICATE_STORE', 'MSSQL_CNG_STORE', 'MSSQL_CSP_PROVIDER'. Valid (currently registered) custom key store provider names are: . Please verify key store provider information in column master key definitions in the database, and verify all custom key store providers used in your application are registered properly.";
+ string errorMessage = "Failed to decrypt a column encryption key. Invalid key store provider name: 'Dummy_Provider'. A key store provider name must denote either a system key store provider or a registered custom key store provider.";
Object cipherMD = Utility.GetSqlCipherMetadata(0, 1, null, 1, 0x03);
Utility.AddEncryptionKeyToCipherMD(cipherMD, CertFixture.encryptedCek, 0, 0, 0, new byte[] { 0x01, 0x02, 0x03 }, CertFixture.certificatePath, "Dummy_Provider", "RSA_OAEP");
byte[] plainText = Encoding.Unicode.GetBytes("HelloWorld");
byte[] cipherText = Utility.EncryptDataUsingAED(plainText, CertFixture.cek, CColumnEncryptionType.Deterministic);
Exception decryptEx = Assert.Throws(() => Utility.DecryptWithKey(plainText, cipherMD, "localhost"));
- Assert.Equal(errorMessage, decryptEx.InnerException.Message);
+ Assert.Contains(errorMessage, decryptEx.InnerException.Message);
Exception encryptEx = Assert.Throws(() => Utility.EncryptWithKey(plainText, cipherMD, "localhost"));
- Assert.Equal(errorMessage, encryptEx.InnerException.Message);
+ Assert.Contains(errorMessage, encryptEx.InnerException.Message);
}
[Fact]
- [ActiveIssue(9658)]
[PlatformSpecific(TestPlatforms.Windows)]
public void TestTceUnknownEncryptionAlgorithm()
{
- string errorMessage = "Encryption algorithm 'Dummy' for the column in the database is either invalid or corrupted. Valid algorithms are: 'AEAD_AES_256_CBC_HMAC_SHA256', 'AES_256_CBC'.";
+ string errorMessage = "Encryption algorithm 'Dummy' for the column in the database is either invalid or corrupted.";
Object cipherMD = Utility.GetSqlCipherMetadata(0, 0, "Dummy", 1, 0x01);
Utility.AddEncryptionKeyToCipherMD(cipherMD, CertFixture.encryptedCek, 0, 0, 0, new byte[] { 0x01, 0x02, 0x03 }, CertFixture.certificatePath, "MSSQL_CERTIFICATE_STORE", "RSA_OAEP");
byte[] plainText = Encoding.Unicode.GetBytes("HelloWorld");
byte[] cipherText = Utility.EncryptDataUsingAED(plainText, CertFixture.cek, Utility.CColumnEncryptionType.Deterministic);
Exception decryptEx = Assert.Throws(() => Utility.DecryptWithKey(cipherText, cipherMD, "localhost"));
- Assert.Equal(errorMessage, decryptEx.InnerException.Message);
+ Assert.Contains(errorMessage, decryptEx.InnerException.Message);
Exception encryptEx = Assert.Throws(() => Utility.EncryptWithKey(plainText, cipherMD, "localhost"));
- Assert.Equal(errorMessage, encryptEx.InnerException.Message);
+ Assert.Contains(errorMessage, encryptEx.InnerException.Message);
}
[Fact]
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 94cb627d09..d52d26d78b 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,14 +1,15 @@
false
+ FunctionalTests
netcoreapp
netfx
Debug;Release;net46-Release;net46-Debug;netcoreapp2.1-Debug;netcoreapp2.1-Release;netcoreapp3.1-Debug;netcoreapp3.1-Release
AnyCPU;x86;x64
- $(ObjFolder)$(Configuration).FunctionalTests
- $(BinFolder)$(Configuration).FunctionalTests
+ $(ObjFolder)$(Configuration).$(Platform).$(AssemblyName)
+ $(BinFolder)$(Configuration).$(Platform).$(AssemblyName)
-
+
@@ -21,6 +22,8 @@
+
+
@@ -51,7 +54,7 @@
-
+
@@ -59,7 +62,7 @@
-
+
@@ -81,10 +84,13 @@
Microsoft.DotNet.XUnitExtensions
-
-
+
+
+
+
+
-
+
diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CertificateUtility.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CertificateUtility.cs
index 68d0c25f68..6a66bf487e 100644
--- a/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CertificateUtility.cs
+++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CertificateUtility.cs
@@ -271,7 +271,7 @@ internal static SqlConnection GetOpenConnection(bool fTceEnabled, SqlConnectionS
conn.Dispose();
throw;
}
-
+
SqlConnection.ClearPool(conn);
return conn;
}
@@ -281,11 +281,7 @@ internal static SqlConnection GetOpenConnection(bool fTceEnabled, SqlConnectionS
///
public static string GetConnectionString(bool fTceEnabled, SqlConnectionStringBuilder sb, bool fSuppressAttestation = false)
{
- SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
- builder.DataSource = sb.DataSource;
- builder.InitialCatalog = sb.InitialCatalog;
- builder.UserID = sb.UserID;
- builder.Password = sb.Password;
+ SqlConnectionStringBuilder builder = sb;
if (fTceEnabled)
{
builder.ColumnEncryptionSetting = SqlConnectionColumnEncryptionSetting.Enabled;
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 7db44f4358..406004ea64 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,7 @@
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}
+ ManualTests
netcoreapp
netfx
false
@@ -9,16 +10,13 @@
AnyCPU;x86;x64
$(DefineConstants);netcoreapp
$(DefineConstants);netfx
- $(ObjFolder)$(Configuration).ManualTests
- $(BinFolder)$(Configuration).ManualTests
+ $(ObjFolder)$(Configuration).$(Platform).$(AssemblyName)
+ $(BinFolder)$(Configuration).$(Platform).$(AssemblyName)
-
-
- Common\System\Collections\DictionaryExtensions.cs
-
+
@@ -57,6 +55,11 @@
+
+
+
+ Common\System\Collections\DictionaryExtensions.cs
+
@@ -236,7 +239,7 @@
-
+
@@ -244,7 +247,6 @@
-
Microsoft.DotNet.XUnitExtensions
@@ -266,20 +268,24 @@
CoreFx.Private.TestUtilities
-
-
+
+
+
+
+
-
+
+
-
+
-
+
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 511a9c0702..b83e9debb0 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,9 @@
$(BinFolder)$(Configuration).$(Platform)\$(AssemblyName)
-
-
+
+
+
+
\ No newline at end of file
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 a0d0585b13..e6e19d1655 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,9 @@
$(BinFolder)$(Configuration).$(Platform)\$(AssemblyName)
-
-
+
+
+
+
\ No newline at end of file
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 bba3565c0e..91bfcd395f 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,9 @@
$(BinFolder)$(Configuration).$(Platform)\$(AssemblyName)
-
-
+
+
+
+
\ No newline at end of file
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 2415e28685..5826c8f99e 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,9 @@
$(BinFolder)$(Configuration).$(Platform)\$(AssemblyName)
-
-
+
+
+
+
\ No newline at end of file
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
new file mode 100644
index 0000000000..5c1d2ce4c5
--- /dev/null
+++ b/src/Microsoft.Data.SqlClient/tests/NSLibrary/Microsoft.Data.SqlClient.NSLibrary.csproj
@@ -0,0 +1,13 @@
+
+
+
+ netstandard2.0
+ AnyCPU;x86;x64
+ $(ObjFolder)$(Configuration).$(Platform)\$(AssemblyName)
+ $(BinFolder)$(Configuration).$(Platform)\$(AssemblyName)
+
+
+
+
+
+
diff --git a/src/NuGet.config b/src/NuGet.config
index cb7e89cd4a..a86959a3b3 100644
--- a/src/NuGet.config
+++ b/src/NuGet.config
@@ -1,4 +1,4 @@
-
+
diff --git a/tools/props/Versions.props b/tools/props/Versions.props
index a56e0d4473..1249841110 100644
--- a/tools/props/Versions.props
+++ b/tools/props/Versions.props
@@ -9,7 +9,7 @@
- 1.1.*
+ 2.0.0-preview1.20141.10
4.3.1
4.3.0
@@ -24,7 +24,7 @@
4.7.0
- 4.4.0
+ 2.0.0-preview1.20141.10
4.7.0
4.7.0
4.7.0
@@ -61,4 +61,8 @@
5.0.0-beta.20206.4
2.0.8
+
+ $(NugetPackageVersion)
+ $(NugetPackageVersion)
+
diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec
index a5079f9f52..41e7f643c9 100644
--- a/tools/specs/Microsoft.Data.SqlClient.nuspec
+++ b/tools/specs/Microsoft.Data.SqlClient.nuspec
@@ -27,13 +27,13 @@ When using NuGet 3.x this package requires at least version 3.4.
sqlclient microsoft.data.sqlclient
-
+
-
+
@@ -45,7 +45,7 @@ When using NuGet 3.x this package requires at least version 3.4.
-
+
@@ -57,7 +57,7 @@ When using NuGet 3.x this package requires at least version 3.4.
-
+
@@ -99,75 +99,75 @@ 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 fcf2afcccd..62365bd9da 100644
--- a/tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec
+++ b/tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec
@@ -48,21 +48,21 @@ Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyStoreProvider.SqlColumnEncrypti
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
diff --git a/tools/testsql/createNorthwindDb.sql b/tools/testsql/createNorthwindDb.sql
index fd12f1821e..01f48aaec6 100644
--- a/tools/testsql/createNorthwindDb.sql
+++ b/tools/testsql/createNorthwindDb.sql
@@ -18,8 +18,6 @@ END
CREATE DATABASE [Northwind]
GO
-ALTER DATABASE [Northwind] SET COMPATIBILITY_LEVEL = 100
-GO
ALTER DATABASE [Northwind] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [Northwind] SET ANSI_NULLS OFF
diff --git a/tools/vsconfig/VS17Components.vsconfig b/tools/vsconfig/VS17Components.vsconfig
deleted file mode 100644
index b60266c111..0000000000
--- a/tools/vsconfig/VS17Components.vsconfig
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "version": "1.0",
- "components": [
- "Microsoft.VisualStudio.Workload.ManagedDesktop",
- "Microsoft.VisualStudio.Workload.NativeDesktop",
- "Microsoft.VisualStudio.Workload.Azure",
- "Microsoft.VisualStudio.Workload.NetCoreTools",
- "microsoft.net.componentgroup.targetingpacks.common",
- "microsoft.visualstudio.component.debugger.justintime",
- "microsoft.visualstudio.component.liveunittesting",
- "microsoft.visualstudio.component.vc.tools.x86.x64",
- "microsoft.visualstudio.component.windows10sdk.17763",
- "microsoft.visualstudio.componentgroup.nativedesktop.win81",
- "microsoft.visualstudio.component.vc.140",
- "microsoft.visualstudio.component.appinsights.tools",
- "microsoft.visualstudio.component.debugger.snapshot",
- "microsoft.visualstudio.component.aspnet45",
- "microsoft.visualstudio.component.webdeploy",
- "microsoft.netcore.componentgroup.web",
- "microsoft.visualstudio.component.testtools.webloadtest",
- "microsoft.component.azure.datalake.tools",
- "microsoft.visualstudio.componentgroup.azure.resourcemanager.tools",
- "microsoft.visualstudio.componentgroup.azure.cloudservices",
- "microsoft.visualstudio.component.azure.mobileappssdk",
- "microsoft.visualstudio.component.azure.servicefabric.tools",
- "microsoft.visualstudio.component.testtools.core",
- "microsoft.visualstudio.component.typescript.2.3",
- "microsoft.visualstudio.component.testtools.microsofttestmanager",
- "microsoft.visualstudio.component.typescript.3.0"
- ]
-}
\ No newline at end of file