diff --git a/.editorconfig b/.editorconfig
index 7acdd43c13..db85dde7fd 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -140,6 +140,9 @@ dotnet_diagnostic.CA1063.severity = silent
# CA2100: Review SQL queries for security vulnerabilities
dotnet_diagnostic.CA2100.severity = silent
+# CA1416: Validate platform compatibility
+dotnet_diagnostic.CA1416.severity = silent
+
[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
indent_size = 2
diff --git a/BUILDGUIDE.md b/BUILDGUIDE.md
index 05b0920307..47cacc9fb7 100644
--- a/BUILDGUIDE.md
+++ b/BUILDGUIDE.md
@@ -17,7 +17,7 @@ Once the environment is setup properly, execute the desired set of commands belo
msbuild
# Builds the driver for the Client OS in 'Debug' Configuration for 'AnyCPU' platform.
-# Both .NET Framework (NetFx) and .NET Core drivers are built by default (as supported by Client OS).
+# Both .NET Framework (NetFx) and .NET (CoreFx) drivers are built by default (as supported by Client OS).
```
```bash
@@ -30,11 +30,6 @@ msbuild -p:Configuration=Release
# Builds the driver in 'Release' Configuration for `AnyCPU` platform.
```
-```bash
-msbuild -p:Platform=Win32
-# Builds the .NET Framework (NetFx) driver for Win32 (x86) platform on Windows in 'Debug' Configuration.
-```
-
```bash
msbuild -t:restore
# Restores Nuget Packages.
@@ -58,14 +53,14 @@ msbuild -p:OSGroup=Unix
```bash
msbuild -t:BuildNetCoreAllOS
-# Builds the .NET Core driver for all Operating Systems.
+# Builds the .NET driver for all Operating Systems.
```
## Building Tests
```bash
msbuild -t:BuildTestsNetCore
-# Build the tests for the .NET Core driver in 'Debug' Configuration. Default .NET Core version is 3.1.
+# Build the tests for the .NET driver in 'Debug' Configuration. Default .NET version is 6.0.
```
```bash
@@ -86,23 +81,28 @@ There are 2 ways to run tests, using MsBuild or Dotnet SDK.
```bash
msbuild -t:RunFunctionalTests
-# Run all functional tests for *default* target framework (.NET Core 3.1).
+# Run all functional tests in Debug configuration for *default* target framework (.NET 6.0).
```
```bash
msbuild -t:RunManualTests
-# Run all manual tests for *default* target framework (.NET Core 3.1).
+# Run all manual tests in Debug configuration for *default* target framework (.NET 6.0).
```
```bash
msbuild -t:RunTests -p:configuration=Release
-# Run both functional and manual tests for *default* target framework (.NET Core 3.1).
+# Run both functional and manual tests in Release configuration for *default* target framework (.NET 6.0).
+```
+
+```bash
+msbuild -t:RunTests -p:configuration=Release -p:DotnetPath=C:\net6-win-x86\
+# Run both functional and manual tests in Release configuration for *default* target framework (.NET 6.0) against the installed dotnet tool in the provided path.
```
To specify custom target framework, use `TF` property:
```bash
-msbuild -t:RunTests -p:configuration=Release -p:TF=net5.0
+msbuild -t:RunTests -p:configuration=Release -p:TF=net7.0
msbuild -t:RunTests -p:configuration=Release -p:TF=net48
# Runs tests for specified target framework.
# TargetNetCoreVersion and TargetNetFxVersion are not to be used with TF property, they will take precedence over TF if provided.
@@ -125,7 +125,7 @@ Other properties can be set alongside as needed.
- Windows (`netfx x86`):
```bash
-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"
+dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Platform="x86" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests"
```
- Windows (`netfx x64`):
@@ -135,9 +135,11 @@ dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.S
```
- AnyCPU:
+
+ Project reference only builds Driver with `AnyCPU` platform, and underlying process decides to run the tests with a compatible architecture (x64, x86, ARM64).
Windows (`netcoreapp`):
-
+
```bash
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"
```
@@ -184,14 +186,16 @@ Manual Tests require the below setup to run:
|DNSCachingConnString | Connection string for a server that supports DNS Caching|
|IsAzureSynpase | (Optional) When set to 'true', test suite runs compatible tests for Azure Synapse/Parallel Data Warehouse. | `true` OR `false`|
|EnclaveAzureDatabaseConnString | (Optional) Connection string for Azure database with enclaves |
- |MakecertPath | The full path to makecert.exe. This is not required if the path is present in the PATH environment variable. | `D:\\escaped\\absolute\\path\\to\\makecert.exe` |
+ |ManagedIdentitySupported | (Optional) When set to `false` **Managed Identity** related tests won't run. The default value is `true`. |
+ |IsManagedInstance | (Optional) When set to `true` **TVP** related tests will use on non-Azure bs files to compare test results. this is needed when testing against Managed Instances or TVP Tests will fail on Test set 3. The default value is `false`. |
+ |PowerShellPath | The full path to PowerShell.exe. This is not required if the path is present in the PATH environment variable. | `D:\\escaped\\absolute\\path\\to\\PowerShell.exe` |
### Commands to run Manual Tests
- Windows (`netfx x86`):
```bash
-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"
+dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Platform="x86" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests"
```
- Windows (`netfx x64`):
@@ -240,9 +244,11 @@ Tests can be built and run with custom "Reference Type" property that enables di
> msbuild -p:configuration=Release
> ```
+A non-AnyCPU platform reference can only be used with package and NetStandardPackage reference types. Otherwise, the specified platform will be replaced with AnyCPU in the build process.
+
### Building Tests with Reference Type
-For .NET Core, all 4 reference types are supported:
+For .NET, all 4 reference types are supported:
```bash
msbuild -t:BuildTestsNetCore -p:ReferenceType=Project
@@ -281,13 +287,13 @@ Tests can be built and run with custom Target Frameworks. See the below examples
```bash
msbuild -t:BuildTestsNetFx -p:TargetNetFxVersion=net462
# Build the tests for custom TargetFramework (.NET Framework)
-# Applicable values: net462 (Default) | net462 | net47 | net471 net472 | net48
+# Applicable values: net462 (Default) | net47 | net471 net472 | net48 | net481
```
```bash
-msbuild -t:BuildTestsNetCore -p:TargetNetCoreVersion=netcoreapp3.1
-# Build the tests for custom TargetFramework (.NET Core)
-# Applicable values: netcoreapp3.1 | net5.0 | net6.0
+msbuild -t:BuildTestsNetCore -p:TargetNetCoreVersion=net6.0
+# Build the tests for custom TargetFramework (.NET)
+# Applicable values: net6.0 | net7.0
```
### Running Tests with custom target framework (traditional)
@@ -295,11 +301,11 @@ msbuild -t:BuildTestsNetCore -p:TargetNetCoreVersion=netcoreapp3.1
```bash
dotnet test -p:TargetNetFxVersion=net462 ...
# Use above property to run Functional Tests with custom TargetFramework (.NET Framework)
-# Applicable values: net462 (Default) | net462 | net47 | net471 net472 | net48
+# Applicable values: net462 (Default) | net47 | net471 net472 | net48 | net481
-dotnet test -p:TargetNetCoreVersion=netcoreapp3.1 ...
-# Use above property to run Functional Tests with custom TargetFramework (.NET Core)
-# Applicable values: netcoreapp3.1 | net5.0 | net6.0
+dotnet test -p:TargetNetCoreVersion=net6.0 ...
+# Use above property to run Functional Tests with custom TargetFramework (.NET)
+# Applicable values: net6.0 | net7.0
```
## Using Managed SNI on Windows
@@ -320,12 +326,6 @@ Scaled decimal parameter truncation can be enabled by enabling the below AppCont
`Switch.Microsoft.Data.SqlClient.LegacyRowVersionNullBehavior`
-## Enabling OS secure protocols preference
-
-TLS 1.3 has been excluded due to the fact that the driver lacks full support. To enable OS preferences as before, enable the following AppContext switch on application startup:
-
-`Switch.Microsoft.Data.SqlClient.EnableSecureProtocolsByOS`
-
## Suppressing TLS security warning
When connecting to a server, if a protocol lower than TLS 1.2 is negotiated, a security warning is output to the console. This warning can be suppressed on SQL connections with `Encrypt = false` by enabling the following AppContext switch on application startup:
@@ -389,7 +389,7 @@ Configure `runnerconfig.json` file with connection string and preferred settings
```bash
cd src\Microsoft.Data.SqlClient\tests\PerformanceTests
-dotnet run -c Release -f netcoreapp3.1|net5.0
+dotnet run -c Release -f net6.0|net7.0
```
_Only "**Release** Configuration" applies to Performance Tests_
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 596ec8a5e3..129ca46b22 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,87 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+## [Stable release 5.1.0] - 2023-01-19
+
+This update brings the below changes over the previous release:
+
+### Fixed
+
+- Fixed thread safety of transient error list in configurable retry logic. [#1882](https://github.com/dotnet/SqlClient/pull/1882)
+- Fixed deadlock when using SinglePhaseCommit with distributed transactions. [#1801](https://github.com/dotnet/SqlClient/pull/1801)
+- Fixed Dedicated Admin Connections (DAC) to localhost in managed SNI. [#1865](https://github.com/dotnet/SqlClient/pull/1865)
+
+### Changed
+
+- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `5.1.0`. [#1889](https://github.com/dotnet/SqlClient/pull/1889) which includes fix for AppDomain crash in issue [#1418](https://github.com/dotnet/SqlClient/issues/1418), TLS 1.3 Support, removal of ARM32 binaries, and support for the `ServerCertificate` option.
+- Code health improvements [#1867](https://github.com/dotnet/SqlClient/pull/1867) [#1849](https://github.com/dotnet/SqlClient/pull/1849)
+
+## [Preview Release 5.1.0-preview2.22314.2] - 2022-11-10
+
+This update brings the below changes over the previous release:
+
+### Breaking changes over preview release v5.1.0-preview1
+
+- Dropped support for .NET Core 3.1. [#1704](https://github.com/dotnet/SqlClient/pull/1704) [#1823](https://github.com/dotnet/SqlClient/pull/1823)
+
+### Added
+
+- Added support for .NET 6.0. [#1704](https://github.com/dotnet/SqlClient/pull/1704)
+- Added support for `DateOnly` and `TimeOnly` for `SqlParameter` value and `GetFieldValue`. [#1813](https://github.com/dotnet/SqlClient/pull/1813)
+- Added support for TLS 1.3 for .NET Core and SNI Native. [#1821](https://github.com/dotnet/SqlClient/pull/1821)
+- Added `ServerCertificate` support for `Encrypt=Mandatory` or `Encrypt=Strict`. [#1822](https://github.com/dotnet/SqlClient/pull/1822)
+- Added Windows ARM64 support when targeting .NET Framework. [#1828](https://github.com/dotnet/SqlClient/pull/1828)
+
+### Fixed
+
+- Fixed memory leak regression from [#1781](https://github.com/dotnet/SqlClient/pull/1781) using a `DisposableTemporaryOnStack` struct. [#1818](https://github.com/dotnet/SqlClient/pull/1818)
+
+### Changed
+
+- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `5.1.0-preview2.22311.2`. [#1831](https://github.com/dotnet/SqlClient/pull/1831) which includes the fix for the TLS 1.3 timeout and double handshake issue, removal of ARM32 binaries, and support for the `ServerCertificate` option. [#1822](https://github.com/dotnet/SqlClient/issues/1822)
+- Reverted "Excluding unsupported TLS protocols" for issue [#1151](https://github.com/dotnet/SqlClient/issues/1151) (i.e. removed `Switch.Microsoft.Data.SqlClient.EnableSecureProtocolsByOS`) by adding support for TLS 1.3. [#1824](https://github.com/dotnet/SqlClient/issues/1824)
+- Code health improvements [#1812](https://github.com/dotnet/SqlClient/pull/1812) [#1520](https://github.com/dotnet/SqlClient/pull/1520)
+
+## [Preview Release 5.1.0-preview1.22279.3] - 2022-10-19
+
+This update brings the below changes over the previous release:
+
+### Fixed
+
+- Fixed `ReadAsync()` behavior to register Cancellation token action before streaming results. [#1781](https://github.com/dotnet/SqlClient/pull/1781)
+- Fixed `NullReferenceException` when assigning `null` to `SqlConnectionStringBuilder.Encrypt`. [#1778](https://github.com/dotnet/SqlClient/pull/1778)
+- Fixed missing `HostNameInCertificate` property in .NET Framework Reference Project. [#1776](https://github.com/dotnet/SqlClient/pull/1776)
+- Fixed async deadlock issue when sending attention fails due to network failure. [#1766](https://github.com/dotnet/SqlClient/pull/1766)
+- Fixed failed connection requests in ConnectionPool in case of PoolBlock. [#1768](https://github.com/dotnet/SqlClient/pull/1768)
+- Fixed hang on infinite timeout and managed SNI. [#1742](https://github.com/dotnet/SqlClient/pull/1742)
+- Fixed Default UTF8 collation conflict. [#1739](https://github.com/dotnet/SqlClient/pull/1739)
+
+### Changed
+
+- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `5.1.0-preview1.22278.1`. [#1787](https://github.com/dotnet/SqlClient/pull/1787) which includes TLS 1.3 Support and fix for AppDomain crash in issue [#1418](https://github.com/dotnet/SqlClient/issues/1418)
+- Changed the `SqlConnectionEncryptOption` string parser to public. [#1771](https://github.com/dotnet/SqlClient/pull/1771)
+- Converted `ExecuteNonQueryAsync` to use async context object. [#1692](https://github.com/dotnet/SqlClient/pull/1692)
+- Code health improvements [#1604](https://github.com/dotnet/SqlClient/pull/1604) [#1598](https://github.com/dotnet/SqlClient/pull/1598) [#1595](https://github.com/dotnet/SqlClient/pull/1595) [#1443](https://github.com/dotnet/SqlClient/pull/1443)
+
+### Known issues
+
+- When using `Encrypt=Strict` with TLS v1.3, the TLS handshake occurs twice on initial connection on .NET Framework due to a timeout during the TLS handshake and a retry helper re-establishes the connection; however, on .NET Core, it will throw a `System.ComponentModel.Win32Exception (258): The wait operation timed out.` and is being investigated. If you're using Microsoft.Data.SqlClient with .NET Core on Windows 11, you will need to enable the managed SNI on Windows context switch using following statement `AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows", true);` to use TLS v1.3 or disabling TLS 1.3 from the registry by assigning `0` to the following `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client\Enabled` registry key and it'll use TLS v1.2 for the connection. This will be fixed in a future release.
+
+## [Stable release 5.0.1] - 2022-10-07
+
+### Fixed
+
+- Fixed missing `HostNameInCertificate` connection string property in .NET Framework. [#1782](https://github.com/dotnet/SqlClient/pull/1782)
+- Fixed async deadlock issue when sending attention fails due to network failure. [#1783](https://github.com/dotnet/SqlClient/pull/1783)
+- Fixed **Null Reference Exception** on assigning `null` to `SqlConnectionStringBuilder.Encrypt`. [#1784](https://github.com/dotnet/SqlClient/pull/1784)
+- Fixed `ReadAsync()` behavior to register Cancellation token action before streaming results. [#1785](https://github.com/dotnet/SqlClient/pull/1785)
+- Fixed hang on infinite timeout and managed SNI. [#1798](https://github.com/dotnet/SqlClient/pull/1798)
+- Fixed Default UTF8 collation conflict. [#1799](https://github.com/dotnet/SqlClient/pull/1799)
+
+### Changed
+
+- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `5.0.1` [#1795](https://github.com/dotnet/SqlClient/pull/1795), which includes the fix for AppDomain crash introducing in issue [#1418](https://github.com/dotnet/SqlClient/issues/1418).
+
## [Stable release 5.0.0] - 2022-08-05
This update brings the below changes over the previous release:
@@ -104,6 +185,7 @@ This update brings the below changes over the previous release:
- Fixed thread safety issue for `GetEnclaveProvider` by converting dictionary to concurrent dictionary. [#1451](https://github.com/dotnet/SqlClient/pull/1451)
### Changed
+
- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `v5.0.0-preview1.22062.1`. [#1537](https://github.com/dotnet/SqlClient/pull/1537)
- Modernized style in ValueUtilSmi. [#1351](https://github.com/dotnet/SqlClient/pull/1351)
- Changed SQL server codenames to version names. [#1439](https://github.com/dotnet/SqlClient/pull/1439)
@@ -113,17 +195,49 @@ This update brings the below changes over the previous release:
- Sqlstream, SqlInternalTransaction and MetaDataUtilsSmi are moved to shared folder. [#1337](https://github.com/dotnet/SqlClient/pull/1337), [#1346](https://github.com/dotnet/SqlClient/pull/1346) and [#1339](https://github.com/dotnet/SqlClient/pull/1339)
- Various code improvements: [#1197](https://github.com/dotnet/SqlClient/pull/1197), [#1313](https://github.com/dotnet/SqlClient/pull/1313),[#1330](https://github.com/dotnet/SqlClient/pull/1330),[#1366](https://github.com/dotnet/SqlClient/pull/1366), [#1435](https://github.com/dotnet/SqlClient/pull/1435),[#1478](https://github.com/dotnet/SqlClient/pull/1478)
+## [Stable release 4.1.1] - 2022-09-13
+
+### Fixed
+
+- Fixed connection failure by not requiring Certificate Revocation List (CRL) check during authentication. [#1706](https://github.com/dotnet/SqlClient/pull/1706)
+- Parallelize SSRP requests on Linux and macOS when MultiSubNetFailover is specified. [#1708](https://github.com/dotnet/SqlClient/pull/1708), [#1746](https://github.com/dotnet/SqlClient/pull/1746)
+- Added CommandText length validation when using stored procedure command types. [#1709](https://github.com/dotnet/SqlClient/pull/1709)
+- Fixed NullReferenceException during Azure Active Directory authentication. [#1710](https://github.com/dotnet/SqlClient/pull/1710)
+- Fixed null SqlBinary as rowversion. [#1712](https://github.com/dotnet/SqlClient/pull/1712)
+- Fixed table's collation overriding with default UTF8 collation. [#1749](https://github.com/dotnet/SqlClient/pull/1749)
+
+## Changed
+
+- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `v4.0.1` [#1755](https://github.com/dotnet/SqlClient/pull/1755), which includes the fix for AppDomain crash introducing in issue [#1418](https://github.com/dotnet/SqlClient/issues/1418)
+- Various code improvements: [#1711](https://github.com/dotnet/SqlClient/pull/1711)
+
## [Stable release 4.1.0] - 2022-01-31
### Added
- Added new Attestation Protocol `None` for `VBS` enclave types. This protocol will allow users to forgo enclave attestation for VBS enclaves. [#1419](https://github.com/dotnet/SqlClient/pull/1419) [#1425](https://github.com/dotnet/SqlClient/pull/1425)
+## [Stable release 4.0.2] - 2022-09-13
+
+### Fixed
+
+- Fixed connection failure by not requiring Certificate Revocation List (CRL) check during authentication. [#1718](https://github.com/dotnet/SqlClient/pull/1718)
+- Parallelize SSRP requests on Linux and macOS when MultiSubNetFailover is specified. [#1720](https://github.com/dotnet/SqlClient/pull/1720), [#1747](https://github.com/dotnet/SqlClient/pull/1747)
+- Added CommandText length validation when using stored procedure command types. [#1721](https://github.com/dotnet/SqlClient/pull/1721)
+- Fixed NullReferenceException during Azure Active Directory authentication. [#1722](https://github.com/dotnet/SqlClient/pull/1722)
+- Fixed null SqlBinary as rowversion. [#1724](https://github.com/dotnet/SqlClient/pull/1724)
+- Fixed table's collation overriding with default UTF8 collation. [#1750](https://github.com/dotnet/SqlClient/pull/1750)
+
+## Changed
+
+- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `v4.0.1` [#1754](https://github.com/dotnet/SqlClient/pull/1754), which includes the fix for AppDomain crash introducing in issue [#1418](https://github.com/dotnet/SqlClient/issues/1418)
+- Various code improvements: [#1723](https://github.com/dotnet/SqlClient/pull/1723)
+
## [Stable release 4.0.1] - 2022-01-17
### Added
-Added AppContext switch `SuppressInsecureTLSWarning` to allow suppression of TLS security warning when using `Encrypt=false` in the connection string. [#1457](https://github.com/dotnet/SqlClient/pull/1457)
+Added AppContext switch `SuppressInsecureTLSWarning` to allow suppression of TLS security warning when using `Encrypt=false` in the connection string. [#1457](https://github.com/dotnet/SqlClient/pull/1457)
### Fixed
@@ -199,11 +313,13 @@ This update brings the below changes over the previous release:
## [Preview Release 4.0.0-preview1.21237.2] - 2021-08-25
### Breaking changes over stable release 3.0.0
+
- Changed `Encrypt` connection string property to be `true` by default. [#1210](https://github.com/dotnet/SqlClient/pull/1210)
- The driver now throws `SqlException` replacing `AggregateException` for active directory authentication modes. [#1213](https://github.com/dotnet/SqlClient/pull/1213)
- Dropped obsolete `Asynchronous Processing` connection property from .NET Framework. [#1148](https://github.com/dotnet/SqlClient/pull/1148)
### Added
+
- Added `SqlCommand.EnableOptimizedParameterBinding` property that when enabled increases performance for commands with very large numbers of parameters. [#1041](https://github.com/dotnet/SqlClient/pull/1041)
- Included `42108` and `42109` error codes to retriable transient errors list. [#1215](https://github.com/dotnet/SqlClient/pull/1215)
- Added new App Context switch to use OS enabled client protocols only. [#1168](https://github.com/dotnet/SqlClient/pull/1168)
@@ -212,6 +328,7 @@ This update brings the below changes over the previous release:
- Added PropertyGrid support with component model annotations to `SqlConnectionStringBuilder` properties for .NET Core. [#1152](https://github.com/dotnet/SqlClient/pull/1152)
### Fixed
+
- Fixed issue with connectivity when TLS 1.3 is enabled on client and server. [#1168](https://github.com/dotnet/SqlClient/pull/1168)
- Fixed issue with connection encryption to ensure connections fail when encryption is required. [#1210](https://github.com/dotnet/SqlClient/pull/1210)
- Fixed issue where connection goes to unusable state. [#1128](https://github.com/dotnet/SqlClient/pull/1128)
@@ -224,13 +341,23 @@ This update brings the below changes over the previous release:
- Fixed issues in Strings.resx file containing error messages. [#1136](https://github.com/dotnet/SqlClient/pull/1136) [#1178](https://github.com/dotnet/SqlClient/pull/1178)
### Changed
+
- Updated error code to match with Windows when certificate validation fails in non-Windows client environments. [#1130](https://github.com/dotnet/SqlClient/pull/1130)
- Removed designer attributes from `SqlCommand` and `SqlDataAdapter`. [#1132](https://github.com/dotnet/SqlClient/pull/1132)
- Updated configurable retry logic default retriable error list. [#1125](https://github.com/dotnet/SqlClient/pull/1125)
- Improved performance by changing `SqlParameter` bool fields to flags. [#1064](https://github.com/dotnet/SqlClient/pull/1064)
- Improved performance by implementing static delegates. [#1060](https://github.com/dotnet/SqlClient/pull/1060)
- Optimized async method allocations in .NET Framework by porting changes from .NET Core. [#1084](https://github.com/dotnet/SqlClient/pull/1084)
-- Various code improvements [#902](https://github.com/dotnet/SqlClient/pull/902) [#925](https://github.com/dotnet/SqlClient/pull/925) [#933](https://github.com/dotnet/SqlClient/pull/933) [#934](https://github.com/dotnet/SqlClient/pull/934) [#1024](https://github.com/dotnet/SqlClient/pull/1024) [#1057](https://github.com/dotnet/SqlClient/pull/1057) [#1122](https://github.com/dotnet/SqlClient/pull/1122) [#1133]((https://github.com/dotnet/SqlClient/pull/1133)) [#1134](https://github.com/dotnet/SqlClient/pull/1134) [#1141](https://github.com/dotnet/SqlClient/pull/1141) [#1187](https://github.com/dotnet/SqlClient/pull/1187) [#1188](https://github.com/dotnet/SqlClient/pull/1188) [#1223](https://github.com/dotnet/SqlClient/pull/1223) [#1225](https://github.com/dotnet/SqlClient/pull/1225) [#1226](https://github.com/dotnet/SqlClient/pull/1226)
+- Various code improvements [#902](https://github.com/dotnet/SqlClient/pull/902) [#925](https://github.com/dotnet/SqlClient/pull/925) [#933](https://github.com/dotnet/SqlClient/pull/933) [#934](https://github.com/dotnet/SqlClient/pull/934) [#1024](https://github.com/dotnet/SqlClient/pull/1024) [#1057](https://github.com/dotnet/SqlClient/pull/1057) [#1122](https://github.com/dotnet/SqlClient/pull/1122) [#1133](https://github.com/dotnet/SqlClient/pull/1133) [#1134](https://github.com/dotnet/SqlClient/pull/1134) [#1141](https://github.com/dotnet/SqlClient/pull/1141) [#1187](https://github.com/dotnet/SqlClient/pull/1187) [#1188](https://github.com/dotnet/SqlClient/pull/1188) [#1223](https://github.com/dotnet/SqlClient/pull/1223) [#1225](https://github.com/dotnet/SqlClient/pull/1225) [#1226](https://github.com/dotnet/SqlClient/pull/1226)
+
+## [Stable release 3.1.1] - 2022-08-12
+
+### Fixed
+
+- Fixed null SqlBinary as rowversion. [#1700](https://github.com/dotnet/SqlClient/pull/1700)
+- Fixed Kerberos authentication failure when using .NET 6. [#1696](https://github.com/dotnet/SqlClient/pull/1696)
+- Fixed NullReferenceException during Azure Active Directory authentication. [#1695](https://github.com/dotnet/SqlClient/pull/1695)
+- Removed union overlay design and use reflection in `SqlTypeWorkarounds`. [#1699](https://github.com/dotnet/SqlClient/pull/1699)
## [Stable release 3.1.0] - 2022-03-30
@@ -259,16 +386,27 @@ This update brings the below changes over the previous release:
## [Stable Release 3.0.0] - 2021-06-09
### Added
+
- Added support for column encryption key caching when the server supports retrying queries that require enclave computations [#1062](https://github.com/dotnet/SqlClient/pull/1062)
- Added support for configurable retry logic configuration file in .NET Standard [#1090](https://github.com/dotnet/SqlClient/pull/1090)
### Changed
+
- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `v3.0.0` [#1102](https://github.com/dotnet/SqlClient/pull/1102)
- Improved event counter display information [#1091](https://github.com/dotnet/SqlClient/pull/1091)
### Breaking Changes
+
- Modified column encryption key store provider registrations to give built-in system providers precedence over providers registered on connection and command instances. [#1101](https://github.com/dotnet/SqlClient/pull/1101)
+## [Stable Release 2.1.5] - 2022-08-30
+
+### Fixed
+
+- Added CommandText length validation when using stored procedure command types. [#1726](https://github.com/dotnet/SqlClient/pull/1726)
+- Fixed Kerberos authentication failure when using .NET 6. [#1727](https://github.com/dotnet/SqlClient/pull/1727)
+- Removed union overlay design and use reflection in `SqlTypeWorkarounds`. [#1729](https://github.com/dotnet/SqlClient/pull/1729)
+
## [Stable Release 2.1.4] - 2021-09-20
### Fixed
@@ -301,24 +439,27 @@ This update brings the below changes over the previous release:
- Updated error messages for enclave exceptions to include a link to a troubleshooting guide. [#994](https://github.com/dotnet/SqlClient/pull/994)
- Changes to share common files between projects [#1022](https://github.com/dotnet/SqlClient/pull/1022) [#1038](https://github.com/dotnet/SqlClient/pull/1038) [#1040](https://github.com/dotnet/SqlClient/pull/1040) [#1033](https://github.com/dotnet/SqlClient/pull/1033) [#1028](https://github.com/dotnet/SqlClient/pull/1028) [#1039](https://github.com/dotnet/SqlClient/pull/1039)
-
## [Preview Release 3.0.0-preview2.21106.5] - 2021-04-16
### Breaking Changes over preview release v3.0.0-preview1
+
- `User Id` connection property now requires `Client Id` instead of `Object Id` for **User-Assigned Managed Identity** [#1010](https://github.com/dotnet/SqlClient/pull/1010)
- `SqlDataReader` now returns a `DBNull` value instead of an empty `byte[]`. Legacy behavior can be enabled by setting `AppContext` switch **Switch.Microsoft.Data.SqlClient.LegacyRowVersionNullBehavior** [#998](https://github.com/dotnet/SqlClient/pull/998)
### Added
+
- **Microsoft.Data.SqlClient** now depends on **Azure.Identity** library to acquire a token for "Active Directory Managed Identity/MSI" and "Active Directory Service Principal" authentication modes. [#1010](https://github.com/dotnet/SqlClient/pull/1010)
- Upgraded Native SNI dependency to **v3.0.0-preview1** along with enhanced event tracing support [#1006](https://github.com/dotnet/SqlClient/pull/1006)
### Fixed
+
- Fixed wrong data blended with transactions in .NET Core by marking a connection as doomed if the transaction completes or aborts while there is an open result set[#1023](https://github.com/dotnet/SqlClient/pull/1023)
- Fixed derived parameters containing incorrect TypeName [#1020](https://github.com/dotnet/SqlClient/pull/1020)
- Fixed server connection leak possibilities when an exception occurs in pooling layer [#890](https://github.com/dotnet/SqlClient/pull/890)
- Fixed IP connection resolving logic in .NET Core [#1016](https://github.com/dotnet/SqlClient/pull/1016) [#1031](https://github.com/dotnet/SqlClient/pull/1031)
### Changed
+
- Performance improvements in `SqlDateTime` to `DateTime` internal conversion method [#912](https://github.com/dotnet/SqlClient/pull/912)
- Improved memory allocation by avoiding unnecessary context switching [1008](https://github.com/dotnet/SqlClient/pull/1008)
- Updated `Microsoft.Identity.Client` version from **4.21.1** to **4.22.0** [#1036](https://github.com/dotnet/SqlClient/pull/1036)
@@ -329,15 +470,18 @@ This update brings the below changes over the previous release:
## [Preview Release 3.0.0-preview1.21075.2] - 2021-03-15
### Breaking Changes over stable release v2.1
+
- The minimum supported .NET Framework version has been increased to v4.6.1. .NET Framework v4.6.0 is no longer supported. [#899](https://github.com/dotnet/SqlClient/pull/899)
### Added
+
- Added support for Configurable Retry Logic [#693](https://github.com/dotnet/SqlClient/pull/693) [#966](https://github.com/dotnet/SqlClient/pull/966)
- Added support for Event counters in .NET Core 3.1+ and .NET Standard 2.1+ [#719](https://github.com/dotnet/SqlClient/pull/719)
- Added support for Assembly Context Unloading in .NET Core [#913](https://github.com/dotnet/SqlClient/pull/913)
- Added missing `System.Runtime.Caching` dependency for .NET Standard assemblies [#877](https://github.com/dotnet/SqlClient/pull/877)
### Fixed
+
- Fixed wrong results issues by changing the timeout timer to ensure a correct execution state [#906](https://github.com/dotnet/SqlClient/pull/906)
- Fixed Kerberos authentication issues when configured Server Principal Name (SPN) didn't contain default port [#930](https://github.com/dotnet/SqlClient/pull/930)
- Fixed MARS header errors when `MakeReadAsyncBlocking` App Context switch is set to `false` [#910](https://github.com/dotnet/SqlClient/pull/910) [#922](https://github.com/dotnet/SqlClient/pull/922)
@@ -350,6 +494,7 @@ This update brings the below changes over the previous release:
- Fixed event source trace string issue [#940](https://github.com/dotnet/SqlClient/pull/940)
### Changed
+
- Changed App Context switch `MakeReadAsyncBlocking` default to `false` [#937](https://github.com/dotnet/SqlClient/pull/937)
- Replaced usage of `BinaryFormatter` with `DataContractSerializer` [#869](https://github.com/dotnet/SqlClient/pull/869)
- Prohibited `DtdProcessing` on `XmlTextReader` instance in .NET Core [#884](https://github.com/dotnet/SqlClient/pull/884)
@@ -359,17 +504,17 @@ This update brings the below changes over the previous release:
- Partial event source tracing improvements in .NET Core [#867](https://github.com/dotnet/SqlClient/pull/867) [#897](https://github.com/dotnet/SqlClient/pull/897)
- Changes to share common files between NetFx and NetCore source code [#827](https://github.com/dotnet/SqlClient/pull/827) [#835](https://github.com/dotnet/SqlClient/pull/835) [#838](https://github.com/dotnet/SqlClient/pull/838) [#881](https://github.com/dotnet/SqlClient/pull/881)
-
## [Stable Release 1.1.4] - 2021-03-10
### Fixed
+
- Fixed wrong results issues by changing the timeout timer to ensure a correct execution state [#950](https://github.com/dotnet/SqlClient/pull/950)
- Fixed MARS header contains errors issue against .NET Framework 4.8+ [#959](https://github.com/dotnet/SqlClient/pull/959)
-
## [Stable Release 2.1.2] - 2021-03-03
### Fixed
+
- Fixed issue connecting with instance name from a Linux/macOS environment [#874](https://github.com/dotnet/SqlClient/pull/874)
- Fixed wrong results issues by changing the timeout timer to ensure a correct execution state [#929](https://github.com/dotnet/SqlClient/pull/929)
- Fixed a vulnerability by prohibiting `DtdProcessing` on `XmlTextReader` instances in .NET Core [#885](https://github.com/dotnet/SqlClient/pull/885)
@@ -379,23 +524,24 @@ This update brings the below changes over the previous release:
- Fixed event source tracing issues [#941](https://github.com/dotnet/SqlClient/pull/941)
- Fixed MARS header contains errors issue against .NET Framework 4.8.1 [#928](https://github.com/dotnet/SqlClient/pull/928)
-
## [Stable Release 2.1.1] - 2020-12-18
### Fixed
+
- Fixed issue with System-Assigned Managed Identity in Azure Functions [#841](https://github.com/dotnet/SqlClient/pull/841)
- Fixed issue with Kerberos Authentication for .NET Core in Unix environments [#848](https://github.com/dotnet/SqlClient/pull/848)
- Fixed issue with TCP Keep Alive for .NET Core in Unix environments [#855](https://github.com/dotnet/SqlClient/pull/855)
-
## [Stable Release 2.1.0] - 2020-11-19
### Added
+
- Microsoft.Data.SqlClient symbols are now source-linked [#789](https://github.com/dotnet/SqlClient/pull/789)
- Added an API to clear cached access tokens from the token provider [#800](https://github.com/dotnet/SqlClient/pull/800)
- Added `SqlFacetAttribute` implementation [#757](https://github.com/dotnet/SqlClient/pull/757)
### Fixed
+
- Fixed `InvalidOperationException` and `NotSupportedException` errors due to `WriteAsync` collisions [#796](https://github.com/dotnet/SqlClient/pull/796)
- Fixed incorrect Settings.Async flag in `ExecuteXmlReaderAsync` [#782](https://github.com/dotnet/SqlClient/pull/782)
- Fixed a regression in Windows Integrated authentication when using managed networking [#777](https://github.com/dotnet/SqlClient/pull/777)
@@ -403,35 +549,39 @@ This update brings the below changes over the previous release:
- Fixed a serialization issue with `SqlException` in .NET Core [#780](https://github.com/dotnet/SqlClient/pull/780)
### Changed
-- Updated versions of `Microsoft.IdentityModel` package dependencies [#794](https://github.com/dotnet/SqlClient/pull/794)
+- Updated versions of `Microsoft.IdentityModel` package dependencies [#794](https://github.com/dotnet/SqlClient/pull/794)
## [Preview Release 2.1.0-preview2.20297.7] - 2020-10-23
### Added
+
- Added support for Azure Active Directory Managed Identity authentication [#730](https://github.com/dotnet/SqlClient/pull/730)
- Added support to provide a user-defined application client ID when using Active Directory authentication [#740](https://github.com/dotnet/SqlClient/pull/740)
- Added the "Command Timeout" connection string property to set a default timeout for all commands executed with the connection [#722](https://github.com/dotnet/SqlClient/pull/722)
- Added support for Always Encrypted on all supported platforms for .NET Standard 2.0 [#756](https://github.com/dotnet/SqlClient/pull/756)
### Fixed
+
- Fixed unobserved exception issue when a timeout occurs before a faulted task completes with an exception [#688](https://github.com/dotnet/SqlClient/pull/688) [#773](https://github.com/dotnet/SqlClient/pull/773)
- Fixed an issue where driver continues to prompt for credentials when using Azure Active Directory authentication [#770](https://github.com/dotnet/SqlClient/pull/770)
### Changed
+
- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `v2.1.1` and removed symbols from `Microsoft.Data.SqlClient.SNI.runtime`, which are now published to Microsoft Symbols Server [#764](https://github.com/dotnet/SqlClient/pull/764)
- Updated `Microsoft.Identity.Client` dependency version to `v4.21.1` [#765](https://github.com/dotnet/SqlClient/pull/765)
- Performance improvements when establishing an encrypted channel by removing sync over async method calls [#541](https://github.com/dotnet/SqlClient/pull/541)
- Performance improvements by replacing heap-allocated arrays with Spans [#667](https://github.com/dotnet/SqlClient/pull/667)
- Moved common files to shared folder between .NET Framework and .NET Core implementation [#734](https://github.com/dotnet/SqlClient/pull/734) [#753](https://github.com/dotnet/SqlClient/pull/753)
-
## [Stable Release 2.0.1] - 2020-08-25
### Added
+
- Added support for a new Configuration Section, `SqlClientAuthenticationProviders` (duplicate of existing `SqlAuthenticationProviders`), to allow co-existence of configurations for both drivers, "System.Data.SqlClient" and "Microsoft.Data.SqlClient" [#701](https://github.com/dotnet/SqlClient/pull/701)
### Fixed
+
- Fixed pooled connection re-use on access token expiry issue when using Active Directory authentication modes [#639](https://github.com/dotnet/SqlClient/pull/639)
- Fixed transient fault handling for Pooled connections [#638](https://github.com/dotnet/SqlClient/pull/638)
- Fixed Enclave session cache issue with Azure Database [#628](https://github.com/dotnet/SqlClient/pull/628)
@@ -439,10 +589,10 @@ This update brings the below changes over the previous release:
- Fixed configuration section collision issue with System.Data.SqlClient type [#701](https://github.com/dotnet/SqlClient/pull/701)
- Fixed blank error message [HTTP Provider] issues due to unexpected pre-login failures when using Native SNI. Fixed with Microsoft.Data.SqlClient.SNI v2.0.1 and Microsoft.Data.SqlClient.SNI.runtime v2.0.1 release versions.
-
## [Preview Release 2.1.0-preview1.20235.1] - 2020-08-21
### Added
+
- Added support for Always Encrypted with secure enclaves on Unix for .NET Core 2.1+ and on all supported platforms for .NET Standard 2.1+ [#676](https://github.com/dotnet/SqlClient/pull/676)
- Added support for Azure Active Directory Device Code Flow authentication [#597](https://github.com/dotnet/SqlClient/pull/597)
- Added Sensitivity Rank support in Sensitivity Classification information [#626](https://github.com/dotnet/SqlClient/pull/626)
@@ -452,6 +602,7 @@ This update brings the below changes over the previous release:
- Updated Microsoft.Data.SqlClient.SNI (.NET Framework dependency) and Microsoft.Data.SqlClient.SNI.runtime (.NET Core/Standard dependency) version to v2.1.0 with trace logging implementation [#705](https://github.com/dotnet/SqlClient/pull/705)
### Fixed
+
- Fixed Enclave session cache issue with Azure Database [#686](https://github.com/dotnet/SqlClient/pull/686)
- Fixed pooled connection re-use on access token expiry issue when using Active Directory authentication modes [#635](https://github.com/dotnet/SqlClient/pull/635)
- Fixed transient fault handling for Pooled connections [#637](https://github.com/dotnet/SqlClient/pull/637)
@@ -459,6 +610,7 @@ This update brings the below changes over the previous release:
- Fixed missing null checks for `SqlErrors` in `SqlException` for .NET Framework implementation [#698](https://github.com/dotnet/SqlClient/pull/698)
### Changed
+
- Performance improvements by fixing unnecessary allocations with EventSource implementation [#684](https://github.com/dotnet/SqlClient/pull/684)
- Reverted changes to return empty DataTable from GetSchemaTable to return null as before. [#696](https://github.com/dotnet/SqlClient/pull/696)
- Removed multiple `CacheConnectionStringProperties` calls when setting `ConnectionString` properties [#683](https://github.com/dotnet/SqlClient/pull/683)
@@ -469,16 +621,17 @@ This update brings the below changes over the previous release:
- Performance improvements by moving `DataReader` caches to internal connection [#499](https://github.com/dotnet/SqlClient/pull/499)
- Moved common files to shared folder between .NET Framework and .NET Core implementation [#618](https://github.com/dotnet/SqlClient/pull/618) [#625](https://github.com/dotnet/SqlClient/pull/625)
-
## [Stable Release 2.0.0] - 2020-06-16
### Added
+
- Added internal driver support to provide resiliency to DNS failures [#594](https://github.com/dotnet/SqlClient/pull/594)
- Added support for `Active Directory Integrated`, `Active Directory Interactive` and `Active Directory Service Principal` authentication mode for .NET Core and .NET Standard [#560](https://github.com/dotnet/SqlClient/pull/560)
- Added support for `Active Directory Service Principal` authentication mode for .NET Framework [#560](https://github.com/dotnet/SqlClient/pull/560)
- Added support for optional `ORDER` hints in `SqlBulkCopy` for improved performance [#540](https://github.com/dotnet/SqlClient/pull/540)
### Fixed
+
- Fixed `SqlSequentialStream` multipacket read stalling issue in .NET Core [#603](https://github.com/dotnet/SqlClient/pull/603)
- Fixed code page issue for Kazakh collation in SQL Server [#584](https://github.com/dotnet/SqlClient/pull/584)
- Fixed stalled application issues when end of stream is reached [#577](https://github.com/dotnet/SqlClient/pull/577)
@@ -487,80 +640,90 @@ This update brings the below changes over the previous release:
- Fixed `applicationintent` connection string property issue [#585](https://github.com/dotnet/SqlClient/pull/585)
### Changed
+
- Raise warning message when insecure TLS protocols are in use [#591](https://github.com/dotnet/SqlClient/pull/591)
### Breaking Changes
+
- Modified enclave provider interface `SqlColumnEncryptionEnclaveProvider` to be internal [#602](https://github.com/dotnet/SqlClient/pull/602) - _This change is not likely to impact customer applications since secure enclaves is a relatively new feature and they would have had to implement their own enclave provider, which is not a trivial task_.
- Updated `SqlClientMetaDataCollectionNames` exposed constants by removing non-existing constants and adding new to the metadata collection [#580](https://github.com/dotnet/SqlClient/pull/580)
-
## [Preview Release 2.0.0-preview4.20142.4] - 2020-05-21
### Added
+
- Microsoft.Data.SqlClient (.NET Core and .NET Standard) on Windows is now dependent on **Microsoft.Data.SqlClient.SNI.runtime**, replacing the previous dependency on **runtime.native.System.Data.SqlClient.SNI** [#570](https://github.com/dotnet/SqlClient/pull/570)
-- The new **Microsoft.Data.SqlClient.SNI.runtime** dependency adds support for the *ARM* platform along with the already supported platforms *ARM64*, *x64* and *x86* on Windows [#570](https://github.com/dotnet/SqlClient/pull/570)
+- The new **Microsoft.Data.SqlClient.SNI.runtime** dependency adds support for the _ARM_ platform along with the already supported platforms _ARM64_, _x64_ and _x86_ on Windows [#570](https://github.com/dotnet/SqlClient/pull/570)
- Improved driver performance by introducing managed packet recycling [#389](https://github.com/dotnet/SqlClient/pull/389)
### Fixed
+
- Fixed `SqlBulkCopy` to work with database columns containing metadata about data classification [#568](https://github.com/dotnet/SqlClient/pull/568)
- Fixed unsafe cast in `SqlException` for `SerializationEntry.Value`
- Fixed null reference exceptions in `SqlDelegatedTransaction` methods [#563](https://github.com/dotnet/SqlClient/pull/563)
### Changed
+
- Standardized connection string properties for enhanced user experience [#534](https://github.com/dotnet/SqlClient/pull/534)
- Improved performance by reducing eventsource tracing related to allocations from TVP write methods [#557](https://github.com/dotnet/SqlClient/pull/557) [#564](https://github.com/dotnet/SqlClient/pull/564)
### Breaking Changes
-- For .NET Framework applications consuming **Microsoft.Data.SqlClient**, the `SNI.dll` files previously downloaded to the `bin\x64` and `bin\x86` folders are now named `Microsoft.Data.SqlClient.SNI.x64.dll` and `Microsoft.Data.SqlClient.SNI.x86.dll` and will be downloaded to the `bin` directory, to support auto-loading in the application process [#570](https://github.com/dotnet/SqlClient/pull/570). This change is not going to impact client applications unless a direct reference has been made to `SNI.dll` or the x86 and x64 folders.
+- For .NET Framework applications consuming **Microsoft.Data.SqlClient**, the `SNI.dll` files previously downloaded to the `bin\x64` and `bin\x86` folders are now named `Microsoft.Data.SqlClient.SNI.x64.dll` and `Microsoft.Data.SqlClient.SNI.x86.dll` and will be downloaded to the `bin` directory, to support auto-loading in the application process [#570](https://github.com/dotnet/SqlClient/pull/570). This change is not going to impact client applications unless a direct reference has been made to `SNI.dll` or the x86 and x64 folders.
## [Stable Release 1.1.3] - 2020-05-15
### Fixed
+
- Fixed driver behavior to not perform enlistment of pooled connection on aborted transaction [#551](https://github.com/dotnet/SqlClient/pull/551)
- Fixed issues introduced with MARS TDS Header fix in last release by reverting original change that caused issues. [#550](https://github.com/dotnet/SqlClient/pull/550)
-
## [Preview Release 2.0.0-preview3.20122.2] - 2020-05-01
### Added
+
- Allow passing username with Active Directory Interactive Authentication in .NET Framework [#492](https://github.com/dotnet/SqlClient/pull/492)
- Allow large UDT buffers for .NET Framework [#456](https://github.com/dotnet/SqlClient/pull/456)
- Added "Transaction Id" and "Client Version" in Diagnostic Source traces [#515](https://github.com/dotnet/SqlClient/pull/515)
- Added new `SqlConnectionOverrides` APIs to perform `SqlConnection.Open()` with fail fast option [#463](https://github.com/dotnet/SqlClient/pull/463)
### Fixed
+
- Addressed MARS TDS Header errors by reverting changes to make `SqlDataReader.ReadAsync()` non-blocking [#547](https://github.com/dotnet/SqlClient/pull/547)
- Fixed driver behavior to not perform enlistment of pooled connection in aborted transaction [#543](https://github.com/dotnet/SqlClient/pull/543)
- Fixed wrong application domain selected when starting `SqlDependencyListener` [#410](https://github.com/dotnet/SqlClient/pull/410)
- Added missing refs for `RowCopied` property in `SqlBulkCopy` [#508](https://github.com/dotnet/SqlClient/pull/508)
### Changed
+
- Improved performance by removing unwanted method calls in Event Source tracing [#506](https://github.com/dotnet/SqlClient/pull/506)
- Removed Diagnostic Source and Configuration Manager dependencies from .NET Standard implementation [#535](https://github.com/dotnet/SqlClient/pull/535)
- Removed redundant calls to `DbConnectionPoolKey.GetType()` [#512](https://github.com/dotnet/SqlClient/pull/512)
### Breaking Changes
+
- Updated driver to perform decimal scale rounding to match SQL Server behavior [#470](https://github.com/dotnet/SqlClient/pull/470)
- Standardized App Context switch name that enables Managed SNI on Windows for .NET Core and .NET Standard (break only applies to 2.0 preview releases that introduced the switch) [#548](https://github.com/dotnet/SqlClient/pull/548)
-
## [Stable Release 1.1.2] - 2020-04-15
### Added
+
- Allowed passing username with Active Directory Interactive Authentication [#493](https://github.com/dotnet/SqlClient/pull/493) [#516](https://github.com/dotnet/SqlClient/pull/516)
### Fixed
+
- Fixed the ConnectionString's password persistence in .NET Core. [#489](https://github.com/dotnet/SqlClient/pull/489)
- Addressed MARS TDS header containing errors [#510](https://github.com/dotnet/SqlClient/pull/510)
### Changed
-- Updated driver libraries to be CLS Compliant [#522](https://github.com/dotnet/SqlClient/pull/522)
+- Updated driver libraries to be CLS Compliant [#522](https://github.com/dotnet/SqlClient/pull/522)
## [Preview Release 2.0.0-preview2.20084.1] - 2020-03-24
### Added
+
- Added support for capturing EventSource traces in .NET Framework, .NET Core, and .NET Standard applications [#399](https://github.com/dotnet/SqlClient/pull/399) [#461](https://github.com/dotnet/SqlClient/pull/461) [#479](https://github.com/dotnet/SqlClient/pull/479) [#483](https://github.com/dotnet/SqlClient/pull/483) [#484](https://github.com/dotnet/SqlClient/pull/484)
- Added support for Cross-platform TCP Keep Alive applicable to .NET Core 3.1+ applications [#395](https://github.com/dotnet/SqlClient/pull/395)
- Added support for enabling Managed networking implementation on Windows applicable to .NET Core and .NET Standard applications [#477](https://github.com/dotnet/SqlClient/pull/477)
@@ -570,11 +733,13 @@ This update brings the below changes over the previous release:
- Added cached `SqlReferenceCollection.FindLiveReaderContext` objects [#380](https://github.com/dotnet/SqlClient/pull/380)
### Fixed
+
- Fixed Access Token behavior in connection pool to perform string comparison [#443](https://github.com/dotnet/SqlClient/pull/443)
- Fixed concurrent connection speed issues when connecting with Azure Active Directory Authentication modes in .NET Core [#466](https://github.com/dotnet/SqlClient/pull/466)
- Fixed issues with `Password` persistence in Connection String [#453](https://github.com/dotnet/SqlClient/pull/453)
### Changed
+
- Updated all driver assemblies to be CLS Compliant [#396](https://github.com/dotnet/SqlClient/pull/396)
- Updated Bulk Copy error messages to also include Column, Row and non-encrypted Data information [#437](https://github.com/dotnet/SqlClient/pull/437)
- Updated error messages for "Always Encrypted - Secure Enclaves" to handle 'Attestation Protocol' and fixed typos [#421](https://github.com/dotnet/SqlClient/pull/421) [#397](https://github.com/dotnet/SqlClient/pull/397)
@@ -583,25 +748,28 @@ This update brings the below changes over the previous release:
- Multiple performance improvements [#377](https://github.com/dotnet/SqlClient/pull/377) [#378](https://github.com/dotnet/SqlClient/pull/378) [#379](https://github.com/dotnet/SqlClient/pull/379)
### Breaking Changes
+
- The driver will now perform Server Certificate validation when TLS encryption is enforced by the target Server, which is the default for Azure connections [#391](https://github.com/dotnet/SqlClient/pull/391)
- `SqlDataReader.GetSchemaTable()` now returns an empty `DataTable` instead of returning `null` [#419](https://github.com/dotnet/SqlClient/pull/419)
-
## [Stable Release 1.1.1] - 2020-02-14
### Fixed
+
- Fixed deadlock issues by reverting async changes to `SNIPacket` [#425](https://github.com/dotnet/SqlClient/pull/425)
### Changed
-- Updated SNI package reference to include version range [#425](https://github.com/dotnet/SqlClient/pull/425)
+- Updated SNI package reference to include version range [#425](https://github.com/dotnet/SqlClient/pull/425)
## [Preview Release 2.0.0-preview1.20021.1] - 2020-01-21
### Added
+
- Added support to allow large UDT buffer size (_upto_ `Int.MaxValue`) as supported by SQL Server starting TDS 7.3 [#340](https://github.com/dotnet/SqlClient/pull/340)
### Fixed
+
- Fixed issues with `SqlCommandSet` not working with Byte Array parameters [#360](https://github.com/dotnet/SqlClient/pull/360)
- Fixed Statement command cancellation in Managed SNI [#248](https://github.com/dotnet/SqlClient/pull/248) - Ported [dotnet/corefx#38271](https://github.com/dotnet/corefx/pull/38271)
- Fixed zero connection timeout issue in Managed SNI [#332](https://github.com/dotnet/SqlClient/pull/332)
@@ -611,6 +779,7 @@ This update brings the below changes over the previous release:
- Fixed deadlock issues by reverting async changes to `SNIPacket` [#349](https://github.com/dotnet/SqlClient/pull/349)
### Changed
+
- Improved performance of Managed SNI by removing double fetch of domain name [#366](https://github.com/dotnet/SqlClient/pull/366)
- Improved performance of Async Method Allocations in Managed SNI [#328](https://github.com/dotnet/SqlClient/pull/328)
- Improved performance of Managed SNI by enhancing utilization of resources [#173](https://github.com/dotnet/SqlClient/pull/173) - Ported [dotnet/corefx#35363](https://github.com/dotnet/corefx/pull/35363) and [dotnet/corefx#40732](https://github.com/dotnet/corefx/pull/40732)
@@ -619,31 +788,34 @@ This update brings the below changes over the previous release:
- Changed `Recieve()` and `ReceiveAsync()` implementation to receive null packets on failure [#350](https://github.com/dotnet/SqlClient/pull/350)
- Changed `EnclaveProviderBase` caching implementation to support Async Scenarios _(Introduces breaking changes)_ [#346](https://github.com/dotnet/SqlClient/pull/346)
-
## [Stable Release 1.1.0] - 2019-11-20
### Added
+
- Added support for |DataDirectory| macro in `AttachDBFilename` for .NET Core client [#284](https://github.com/dotnet/SqlClient/pull/284)
### Fixed
+
- Fixed connection resiliency check [#310](https://github.com/dotnet/SqlClient/pull/310)
- Fixed `SNIPacket.ReadFromStreamAsync` to not consume same `ValueTask` twice [#295](https://github.com/dotnet/SqlClient/pull/295)
- Fixed driver behavior to not send Attention signal for successful Bulk Copy operation [#308](https://github.com/dotnet/SqlClient/pull/308)
- Fixed driver behavior to abort connection when encountering `SqlException` on `SqlTransaction.Commit` [#299](https://github.com/dotnet/SqlClient/pull/299)
-- Fixed driver behavior to not throw exception on invalid *app.config* files [#319](https://github.com/dotnet/SqlClient/pull/319)
+- Fixed driver behavior to not throw exception on invalid _app.config_ files [#319](https://github.com/dotnet/SqlClient/pull/319)
### Changed
+
- Improved async read performance by adding multi-packet target buffer caching [#285](https://github.com/dotnet/SqlClient/pull/285)
- Improved performance of `TdsParserStateObject` and `SqlDataReader` snapshot mechanisms [#198](https://github.com/dotnet/SqlClient/pull/198)
- Updated `SqlDataReader.Close` documentation [#314](https://github.com/dotnet/SqlClient/pull/314)
-
## [Preview Release 1.1.0-preview2.19309.1] - 2019-11-04
### Added
+
- Add support for secure enclaves with Always Encrypted [#293](https://github.com/dotnet/SqlClient/pull/293)
### Fixed
+
- Setting the value `DbParameter.DbType` to `DbType.Time` property fails after setting the Value property [#5](https://github.com/dotnet/SqlClient/issues/5)
- `SQLDataAdapter.FillSchema` doesn't mark computed columns as readonly [#275](https://github.com/dotnet/SqlClient/issues/275)
- `SqlDependency.Start` throws `FileNotFoundException` [#260](https://github.com/dotnet/SqlClient/issues/260)
@@ -655,6 +827,7 @@ This update brings the below changes over the previous release:
- Fixing incorrect event id and opcode for the `SqlEventSource` [#241](https://github.com/dotnet/SqlClient/pull/241)
### Changed
+
- Update dependency to Microsoft.Data.SqlClient.SNI v1.1.0 [#276](https://github.com/dotnet/SqlClient/pull/276)
- Correct timeout remarks for async command methods [#264](https://github.com/dotnet/SqlClient/pull/264)
- Improve `SqlBulkCopy` truncation error message [#256](https://github.com/dotnet/SqlClient/issues/256)
@@ -662,23 +835,24 @@ This update brings the below changes over the previous release:
- Enable SQL Command text for non-stored procs in EventSource events for .NET Framework [242](https://github.com/dotnet/SqlClient/pull/242)
- Many test changes to support a public CI
-
## [Preview Release 1.1.0-preview1.19275.1] - 2019-10-02
### Added
+
- Added `SqlFileStream` support for .NET Framework with `Microsoft.Data.SqlTypes.SqlFileStream` class introduced. [#210](https://github.com/dotnet/SqlClient/pull/210)
- Added support for Visual Studio Intellisense with XML Documentation. [#210](https://github.com/dotnet/SqlClient/pull/210)
### Changed
+
- Synchronized ref definitions with driver classes. [#180](https://github.com/dotnet/SqlClient/pull/180)
- Updated `SNINativeMethodWrapper` to provide the underlying error in the inner exception when we fail to load SNI.dll. [#225](https://github.com/dotnet/SqlClient/pull/225)
- Added .editorconfig file and set formatting rules. [#193](https://github.com/dotnet/SqlClient/pull/193)
- Changes done to handle statistics well and to cleanup `AutoResetEvent` on disconnect. [#232](https://github.com/dotnet/SqlClient/pull/232)
-
## [Hotfix & Stable Release 1.0.19269.1] - 2019-09-26
### Fixed Issues
+
- `SqlCommand.StatementCompleted` event never being fired [#212](https://github.com/dotnet/SqlClient/issues/212)
- Added missing `Authentication` property to `SqlConnectionStringBuilder` reference assembly
- Reverted API changes in `SqlAuthenticationParameters` which had changed the `public string Resource` property to `public string[] Scopes`
@@ -686,6 +860,7 @@ This update brings the below changes over the previous release:
## [Hotfix & Stable Release 1.0.19249.1] - 2019-09-06
### Fixed Issues
+
- Fixed issues with large data reading in Unix applications when data is spanned over multiple packets. [#171](https://github.com/dotnet/SqlClient/pull/171)
## [Stable Release 1.0.19239.1] - 2019-08-27
diff --git a/README.md b/README.md
index fe57a1ce45..29f8950a49 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
[](https://raw.githubusercontent.com/dotnet/sqlclient/master/LICENSE)
[](https://www.nuget.org/packages/Microsoft.Data.SqlClient)
[](https://gitter.im/Microsoft/mssql-developers)
+[](https://sqlclientdrivers.visualstudio.com/public/_build/latest?definitionId=1139)
# Microsoft SqlClient Data Provider for SQL Server
@@ -118,4 +119,4 @@ The Microsoft.Data.SqlClient Driver for SQL Server is licensed under the MIT lic
## Trademarks
-This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
\ No newline at end of file
+This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
diff --git a/RunTests.cmd b/RunPackageReferenceTests.cmd
similarity index 64%
rename from RunTests.cmd
rename to RunPackageReferenceTests.cmd
index 663c3da9b4..fd37b9c7ba 100644
--- a/RunTests.cmd
+++ b/RunPackageReferenceTests.cmd
@@ -5,46 +5,100 @@ echo Building .NET Core Tests
call :pauseOnError msbuild -t:Clean
:: ************** IMPORTANT NOTE BEFORE PROCEEDING WITH "PACKAGE" AND "NETSTANDARDPACKAGE" REFERENCE TYPES ***************
+:: THESE ARE NOT STAND ALONE TEST COMMANDS AND NEED A DEVELOPER'S SPECIAL ATTENTION TO WORK. ATTEMPTING TO RUN THE ENTIRE SET OF COMMANDS AS-IS IS LIKELY TO FAIL!
+
:: 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
+:: > MSBuild -p:Configuration=Release
+
+:: Based on `dotnet test` documentation, the `Platform` property has no effect on choosing the underlying architecture for the test execution environment.
+:: You need to install and run the `dotnet` command for a specific architecture (x64, x86, Arm64).
:: 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:BuildAKVNetSt -p:ReferenceType=Package
-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
+:: .NET - REFERENCE TYPE "PACKAGE"
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=Package -p:TargetNetCoreVersion=net6.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=net6.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net6.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=net6.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net6.0-manual-anycpu.xml
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=Package -p:TargetNetCoreVersion=net7.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=net7.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net7.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=net7.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net7.0-manual-anycpu.xml
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=Package -p:Platform=x64 -p:TargetNetCoreVersion=net6.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=net6.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net6.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=net6.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net6.0-manual-x64.xml
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=Package -p:Platform=x64 -p:TargetNetCoreVersion=net7.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=net7.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net7.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=net7.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net7.0-manual-x64.xml
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=Package -p:Platform=Win32 -p:TargetNetCoreVersion=net6.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=net6.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net6.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=net6.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net6.0-manual-win32.xml
-call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=Package -p:TargetNetCoreVersion=net5.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=net5.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=net5.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net5.0-manual-anycpu.xml
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=Package -p:Platform=Win32 -p:TargetNetCoreVersion=net7.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=net7.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net7.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=net7.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net7.0-manual-win32.xml
+
+:: .NET Framework - REFERENCE TYPE "PACKAGE"
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:ReferenceType=Package -p:Platform=AnyCPU -p:TargetNetFxVersion=net462
+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-net462-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-net462-manual-anycpu.xml
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:ReferenceType=Package -p:Platform=AnyCPU -p:TargetNetFxVersion=net48
+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: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:BuildTestsNetFx -p:ReferenceType=Package -p:Platform=x64 -p:TargetNetFxVersion=net462
+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-net462-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-net462-manual-x64.xml
-call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=Package -p:Platform=x64 -p:TargetNetCoreVersion=net5.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=net5.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=net5.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-manual-x64.xml
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:TargetNetFxVersion=net48 -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" -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: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:BuildTestsNetFx -p:ReferenceType=Package -p:Platform=Win32 -p:TargetNetFxVersion=net462
+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-net462-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-net462-manual-win32.xml
-call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=Package -p:Platform=Win32 -p:TargetNetCoreVersion=net5.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=net5.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=net5.0 -p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-manual-win32.xml
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:TargetNetFxVersion=net48 -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" -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
:: REFERENCE TYPE "NETSTANDARDPACKAGE"
-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=net5.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=net5.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=net5.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-manual-anycpu.xml
+:: .NET - REFERENCE TYPE "NETSTANDARDPACKAGE"
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage -p:TargetNetCoreVersion=net6.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=net6.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net6.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=net6.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net6.0-manual-anycpu.xml
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage -p:TargetNetCoreVersion=net7.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=net7.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net7.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=net7.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net7.0-manual-anycpu.xml
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage -p:Platform=x64 -p:TargetNetCoreVersion=net6.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=net6.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net6.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=net6.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net6.0-manual-x64.xml
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage -p:Platform=x64 -p:TargetNetCoreVersion=net7.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=net7.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net7.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=net7.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net7.0-manual-x64.xml
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage -p:Platform=Win32 -p:TargetNetCoreVersion=net6.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=net6.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net6.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=net6.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net6.0-manual-win32.xml
+
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandardPackage -p:Platform=Win32 -p:TargetNetCoreVersion=net7.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=net7.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net7.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=net7.0 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net7.0-manual-win32.xml
+
+:: .NET Framework - REFERENCE TYPE "NETSTANDARDPACKAGE"
call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:ReferenceType=NetStandardPackage -p:TargetNetFxVersion=net462
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=net462 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-functional-anycpu.xml
@@ -54,14 +108,6 @@ call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:Refe
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 -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=net5.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=net5.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=net5.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=net462
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=net462 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-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=net462 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-manual-x64.xml
@@ -70,14 +116,6 @@ call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:Refe
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 -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=net5.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=net5.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=net5.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=net462
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=net462 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-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=net462 -p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-manual-win32.xml
@@ -89,87 +127,17 @@ call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\M
:: 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 -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=net6.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=net6.0 -p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-net6.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=net6.0 -p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-net6.0-manual-anycpu.xml
-call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandard -p:TargetNetCoreVersion=net5.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=net5.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=net5.0 -p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore5.0-manual-anycpu.xml
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:ReferenceType=NetStandard -p:TargetNetCoreVersion=net7.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=net7.0 -p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-net7.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=net7.0 -p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-net7.0-manual-anycpu.xml
:: TESTING 'NETSTANDARD' REFERENCE TYPE WITH .NET FRAMEWORK 4.6.2+ 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:BuildAKVNetStAllOS
-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=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=net5.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=net5.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=net5.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:BuildAKVNetStAllOS
-call :pauseOnError msbuild -p:Configuration="Release" -t:GenerateAKVProviderNugetPackage
-call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx
-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-net462-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-net462-manual-anycpu.xml
-
-call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:TargetNetFxVersion=net48
-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-net462-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-net462-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-net462-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-net462-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-net462-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-net462-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-net462-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-net462-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-net462-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-net462-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
:pauseOnError
diff --git a/RunProjectReferenceTests.cmd b/RunProjectReferenceTests.cmd
new file mode 100644
index 0000000000..3b2208e82d
--- /dev/null
+++ b/RunProjectReferenceTests.cmd
@@ -0,0 +1,47 @@
+@echo off
+
+call :pauseOnError msbuild -t:Clean
+:: .NET FRAMEWORK - REFERENCE TYPE "PROJECT"
+:: Only Builds AnyCPU for project reference!
+
+:: Based on `dotnet test` documentation, the `Platform` property has no effect on choosing the underlying architecture for the test execution environment.
+:: You need to install and run the `dotnet` command for a specific architecture (x64, x86, Arm64).
+
+echo Building .NET Framework Tests ...
+call :pauseOnError msbuild -p:Configuration="Release"
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildAKVNetStAllOS
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildAKVNetFx
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:TargetNetFxVersion=net462
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetFx -p:TargetNetFxVersion=net48
+
+echo Running .NET Framework Tests ...
+call pause
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetfx" -p:TargetNetFxVersion=net462 --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net462-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" -p:TargetNetFxVersion=net462 --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net462-manual-anycpu.xml
+
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj"-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-anycpu.xml
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -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-anycpu.xml
+
+echo Building .NET Tests ...
+call pause
+call :pauseOnError msbuild -t:Clean
+call :pauseOnError msbuild -p:Configuration="Release"
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildAKVNetStAllOS
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildAKVNetCoreAllOS
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:TargetNetCoreVersion=net6.0
+call :pauseOnError msbuild -p:Configuration="Release" -t:BuildTestsNetCore -p:TargetNetCoreVersion=net7.0
+
+echo Running .NET Tests ...
+call pause
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" -p:TargetNetCoreVersion=net6.0 --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net6.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" -p:TargetNetCoreVersion=net6.0 --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net6.0-manual-anycpu.xml
+
+call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" -p:Configuration="Release" -p:TestTargetOS="Windowsnetcoreapp" -p:TargetNetCoreVersion=net7.0 --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net7.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" -p:TargetNetCoreVersion=net7.0 --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-net7.0-manual-anycpu.xml
+
+goto :eof
+
+:pauseOnError
+%*
+if ERRORLEVEL 1 pause
+goto :eof
diff --git a/SUPPORT.md b/SUPPORT.md
index 861787eb5b..51a3996cca 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -4,7 +4,7 @@ Microsoft.Data.SqlClient library follows the latest .NET Core support policy for
[View the .NET Core Support Policy](https://dotnet.microsoft.com/platform/support/policy/dotnet-core)
-[View SqlClient Support Policy on Microsoft Documentation](https://docs.microsoft.com/sql/connect/ado-net/sqlclient-driver-support-lifecycle)
+View GA released version LTS/Current status and support dates here: [SqlClient Support Policy on Microsoft Documentation](https://docs.microsoft.com/sql/connect/ado-net/sqlclient-driver-support-lifecycle)
## Microsoft.Data.SqlClient release cadence
diff --git a/build.proj b/build.proj
index 14efda3f4a..1b3372bc95 100644
--- a/build.proj
+++ b/build.proj
@@ -16,11 +16,11 @@
falseWindowsUnix
- netcoreapp3.1
- netfx
- netcore
- netfx
- netcoreapp
+ net6.0
+ netfx
+ netcore
+ netfx
+ netcoreapp$(TF)$(TF)true
@@ -28,6 +28,12 @@
Configuration=$(Configuration);AssemblyFileVersion=$(AssemblyFileVersion);TargetsWindows=$(TargetsWindows);TargetsUnix=$(TargetsUnix);BuildProjectReferences=false;$(ProjectProperties);BuildForRelease=false;TargetNetCoreVersion=$(TargetNetCoreVersion);TargetNetFxVersion=$(TargetNetFxVersion)TestResults
+
+
@@ -71,8 +77,8 @@
-
-
+
+
@@ -113,8 +119,11 @@
+
+
+
-
+
@@ -129,39 +138,55 @@
-
+
+
+
+
-
+
+
+
+
-
+
+
+
+
+
+
-
+
+
+
+
+
+
-
+
-
+
-
+
-
+
@@ -172,15 +197,23 @@
-
+
-
+
+
+
+
+
+
-
+
+
+
+
diff --git a/doc/snippets/Microsoft.Data.SqlClient/SqlBulkCopy.xml b/doc/snippets/Microsoft.Data.SqlClient/SqlBulkCopy.xml
index 44a5fbab63..d7299c5e80 100644
--- a/doc/snippets/Microsoft.Data.SqlClient/SqlBulkCopy.xml
+++ b/doc/snippets/Microsoft.Data.SqlClient/SqlBulkCopy.xml
@@ -335,8 +335,12 @@ The following example uses the same is `true`, reads from an object using ,
-optimizing memory usage by using the streaming capabilities. When it's set to false, the class loads all the data returned by the
- object into memory before sending it to SQL Server or SQL Azure.
+optimizing memory usage by using the streaming capabilities. Streaming is only applicable to max data types (i.e.
+VARBINARY(MAX), VARCHAR(MAX), NVARCHAR(MAX), and XML). When is set to false,
+the class loads all the data returned by the object into memory before sending it to the server.
+
+> [!NOTE]
+> The main advantage of enabling streaming is reducing memory usage during bulk copy of max data types.
]]>
@@ -504,7 +508,7 @@ and faster to use a Transact-SQL `INSERT … SELECT` statement to copy the data.
## Remarks
This value is incremented during the event and does not imply that this number of rows has been sent to the server or committed.
-During the execution of a bulk copy operation, this value can be accessed, but it cannot be changed. Any attempt to change it will throw an .
+This value can be accessed during or after the execution of a bulk copy operation.
]]>
diff --git a/doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionEnclaveProvider.xml b/doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionEnclaveProvider.xml
index 261f5e57ed..dfbdbe8782 100644
--- a/doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionEnclaveProvider.xml
+++ b/doc/snippets/Microsoft.Data.SqlClient/SqlColumnEncryptionEnclaveProvider.xml
@@ -20,8 +20,8 @@ the enclave attestation protocol as well as the logic for creating and caching e
The information the provider uses to attest the enclave and generate a symmetric key for the session. The format of this information is specific to the enclave attestation protocol.
A Diffie-Hellman algorithm object that encapsulates a client-side key pair.
The set of parameters required for an enclave session.
- The set of extra data needed for attestating the enclave.
- The length of the extra data needed for attestating the enclave.
+ The set of extra data needed for attesting the enclave.
+ The length of the extra data needed for attesting the enclave.
The requested enclave session or if the provider doesn't implement session caching.
A counter that the enclave provider is expected to increment each time SqlClient retrieves the session from the cache. The purpose of this field is to prevent replay attacks.
When overridden in a derived class, performs enclave attestation, generates a symmetric key for the session, creates a an enclave session and stores the session information in the cache.
@@ -29,8 +29,8 @@ the enclave attestation protocol as well as the logic for creating and caching e
The endpoint of an attestation service for attesting the enclave.
- A set of extra data needed for attestating the enclave.
- The length of the extra data needed for attestating the enclave.
+ A set of extra data needed for attesting the enclave.
+ The length of the extra data needed for attesting the enclave.
Gets the information that SqlClient subsequently uses to initiate the process of attesting the enclave and to establish a secure session with the enclave.The information SqlClient subsequently uses to initiate the process of attesting the enclave and to establish a secure session with the enclave.To be added.
@@ -38,10 +38,11 @@ the enclave attestation protocol as well as the logic for creating and caching e
The set of parameters required for enclave session.
to indicate that a set of extra data needs to be generated for attestation; otherwise, .
+ Indicates if this is a retry from a failed call.
When this method returns, the requested enclave session or if the provider doesn't implement session caching. This parameter is treated as uninitialized.
A counter that the enclave provider is expected to increment each time SqlClient retrieves the session from the cache. The purpose of this field is to prevent replay attacks.
- A set of extra data needed for attestating the enclave.
- The length of the extra data needed for attestating the enclave.
+ A set of extra data needed for attesting the enclave.
+ The length of the extra data needed for attesting the enclave.
When overridden in a derived class, looks up an existing enclave session information in the enclave session cache. If the enclave provider doesn't implement enclave session caching, this method is expected to return in the parameter.
To be added.
diff --git a/doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml b/doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml
index 3e30e1cae6..bfc53dddac 100644
--- a/doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml
+++ b/doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml
@@ -528,11 +528,11 @@ End Module
|Application Name|N/A|The name of the application. If no application name is provided, 'Framework Microsoft SqlClient Data Provider' when running on .NET Framework and 'Core Microsoft SqlClient Data Provider' otherwise.
An application name can be 128 characters or less.|
|AttachDBFilename
-or-
Extended Properties
-or-
Initial File Name|N/A|The name of the primary database file, including the full path name of an attachable database. AttachDBFilename is only supported for primary data files with an .mdf extension.
If the value of the AttachDBFileName key is specified in the connection string, the database is attached and becomes the default database for the connection.
If this key is not specified and if the database was previously attached, the database will not be reattached. The previously attached database will be used as the default database for the connection.
If this key is specified together with the AttachDBFileName key, the value of this key will be used as the alias. However, if the name is already used in another attached database, the connection will fail.
The path may be absolute or relative by using the DataDirectory substitution string. If DataDirectory is used, the database file must exist within a subdirectory of the directory pointed to by the substitution string. **Note:** Remote server, HTTP, and UNC path names are not supported.
The database name must be specified with the keyword 'database' (or one of its aliases) as in the following:
An error will be generated if a log file exists in the same directory as the data file and the 'database' keyword is used when attaching the primary data file. In this case, remove the log file. Once the database is attached, a new log file will be automatically generated based on the physical path.|
|Attestation Protocol|NotSpecified|Gets or sets the value of Attestation Protocol.
When no value is specified, secure enclaves are disabled on the connection.
Valid values are: `AAS` `HGS` `None` (Only valid in v3.1 and v4.1+))|
-|Authentication|N/A|The authentication method used for [Connecting to SQL Database By Using Azure Active Directory Authentication](https://azure.microsoft.com/documentation/articles/sql-database-aad-authentication/#7-connect-to-your-database-by-using-azure-active-directory-identities).
Valid values are:
`Active Directory Integrated`, `Active Directory Interactive`, `Active Directory Password`, `Active Directory Service Principal`, `Active Directory Device Code Flow`, `Active Directory Managed Identity`, `Active Directory MSI`, `Active Directory Default`, `Sql Password`.|
+|Authentication|N/A|The authentication method used for [Connecting to SQL Database By Using Azure Active Directory Authentication](https://azure.microsoft.com/documentation/articles/sql-database-aad-authentication/#7-connect-to-your-database-by-using-azure-active-directory-identities).
For additional information see [Using Azure Active Directory authentication with SqlClient](https://docs.microsoft.com/sql/connect/ado-net/sql/azure-active-directory-authentication?view=sql-server-ver15).|
|Column Encryption Setting|disabled|Enables or disables [Always Encrypted](/sql/relational-databases/security/encryption/always-encrypted-database-engine) functionality for the connection. Supported values are: `enabled` and `disabled`|
|Command Timeout|30|The default wait time (in seconds) before terminating the attempt to execute a command and generating an error.
Valid values are greater than or equal to 0 and less than or equal to 2147483647.|
-|Connect Retry Count
-or-
ConnectRetryCount|1|Controls the number of reconnection attempts after the client identifies an idle connection failure. Valid values are 0 to 255. The default is 1. 0 means do not attempt to reconnect (disable connection resiliency).
For additional information about idle connection resiliency, see [Technical Article - Idle Connection Resiliency](https://go.microsoft.com/fwlink/?LinkId=393996).|
-|Connect Retry Interval
-or-
ConnectRetryInterval|10|Specifies the time between each connection retry attempt (`ConnectRetryCount`). Valid values are 1 to 60 seconds (default=10), applied after the first reconnection attempt. When a broken connection is detected, the client immediately attempts to reconnect; this is the first reconnection attempt and only occurs if `ConnectRetryCount` is greater than 0. If the first reconnection attempt fails and `ConnectRetryCount` is greater than 1, the client waits `ConnectRetryInterval` to try the second and subsequent reconnection attempts.
For additional information about idle connection resiliency, see [Technical Article - Idle Connection Resiliency](https://go.microsoft.com/fwlink/?LinkId=393996).|
+|Connect Retry Count
-or-
ConnectRetryCount|1|Controls the number of reconnection attempts after the client identifies an idle connection failure. Valid values are 0 to 255. The default is 1. 0 means do not attempt to reconnect (disable connection resiliency).
For additional information about idle connection resiliency, see[.NET SqlConnection parameters for connection retry](https://learn.microsoft.com/azure/azure-sql/database/troubleshoot-common-connectivity-issues?view=azuresql#net-sqlconnection-parameters-for-connection-retry) and [Technical Article - Idle Connection Resiliency](https://go.microsoft.com/fwlink/?LinkId=393996).|
+|Connect Retry Interval
-or-
ConnectRetryInterval|10|Specifies the time between each connection retry attempt (`ConnectRetryCount`). Valid values are 1 to 60 seconds (default=10), applied after the first reconnection attempt. When a broken connection is detected, the client immediately attempts to reconnect; this is the first reconnection attempt and only occurs if `ConnectRetryCount` is greater than 0. If the first reconnection attempt fails and `ConnectRetryCount` is greater than 1, the client waits `ConnectRetryInterval` to try the second and subsequent reconnection attempts.
For additional information about idle connection resiliency, see[.NET SqlConnection parameters for connection retry](https://learn.microsoft.com/azure/azure-sql/database/troubleshoot-common-connectivity-issues?view=azuresql#net-sqlconnection-parameters-for-connection-retry) and [Technical Article - Idle Connection Resiliency](https://go.microsoft.com/fwlink/?LinkId=393996).|
|Connect Timeout
-or-
Connection Timeout
-or-
Timeout|15|The length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error.
Valid values are greater than or equal to 0 and less than or equal to 2147483647.
When opening a connection to a Azure SQL Database, set the connection timeout to 30 seconds.|
|Current Language
-or-
Language|N/A|Sets the language used for database server warning or error messages.
The language name can be 128 characters or less.|
|Data Source
-or-
Server
-or-
Address
-or-
Addr
-or-
Network Address|N/A|The name or network address of the instance of SQL Server to which to connect. The port number can be specified after the server name:
`server=tcp:servername, portnumber`
When specifying a local instance, always use (local). To force a protocol, add one of the following prefixes:
`np:(local), tcp:(local), lpc:(local)`
You can also connect to a LocalDB database as follows:
`server=(localdb)\\myInstance`
For more information about LocalDB, see [SqlClient Support for LocalDB](/sql/connect/ado-net/sql/sqlclient-support-localdb).
**Data Source** must use the TCP format or the Named Pipes format.
TCP format is as follows:
- tcp:\\\ - tcp:\,\
The TCP format must start with the prefix "tcp:" and is followed by the database instance, as specified by a host name and an instance name. This format is not applicable when connecting to Azure SQL Database. TCP is automatically selected for connections to Azure SQL Database when no protocol is specified.
The host name MUST be specified in one of the following ways:
- NetBIOSName - IPv4Address - IPv6Address
The instance name is used to resolve to a particular TCP/IP port number on which a database instance is hosted. Alternatively, specifying a TCP/IP port number directly is also allowed. If both instance name and port number are not present, the default database instance is used.
The Named Pipes format is as follows:
- np:\\\\\pipe\\
The Named Pipes format MUST start with the prefix "np:" and is followed by a named pipe name.
The host name MUST be specified in one of the following ways:
- NetBIOSName - IPv4Address - IPv6Address
The pipe name is used to identify the database instance to which the .NET application will connect.
If the value of the **Network** key is specified, the prefixes "tcp:" and "np:" should not be specified. **Note:** You can force the use of TCP instead of shared memory, either by prefixing **tcp:** to the server name in the connection string, or by using **localhost**.|
@@ -541,7 +541,8 @@ End Module
|Enlist|'true'|`true` indicates that the SQL Server connection pooler automatically enlists the connection in the creation thread's current transaction context.|
|Failover Partner|N/A|The name of the failover partner server where database mirroring is configured.
If the value of this key is "", then **Initial Catalog** must be present, and its value must not be "".
The server name can be 128 characters or less.
If you specify a failover partner but the failover partner server is not configured for database mirroring and the primary server (specified with the Server keyword) is not available, then the connection will fail.
If you specify a failover partner and the primary server is not configured for database mirroring, the connection to the primary server (specified with the Server keyword) will succeed if the primary server is available.|
|Failover Partner SPN
-or-
FailoverPartnerSPN|N/A|The SPN for the failover partner. The default value is an empty string, which causes SqlClient to use the default, driver-generated SPN.
(Only available in v5.0+)|
-|Host Name In Certificate
-or-
HostNameInCertificate|N/A|Available starting in version 5.0.
The host name to use when validating the server certificate. When not specified, the server name from the Data Source is used for certificate validation.|
+|Host Name In Certificate
-or-
HostNameInCertificate|N/A|The host name to use when validating the server certificate. When not specified, the server name from the Data Source is used for certificate validation.
(Only available in v5.0+)|
+|Server Certificate
-or-
ServerCertificate|N/A|The path to a certificate file to match against the SQL Server TLS/SSL certificate. The accepted certificate formats are PEM, DER, and CER. If specified, the SQL Server certificate is checked by verifying if the ServerCertificate provided is an exact match.
(Only available in v5.1+)|
|Initial Catalog
-or-
Database|N/A|The name of the database.
The database name can be 128 characters or less.|
|Integrated Security
-or-
Trusted_Connection|'false'|When `false`, User ID and Password are specified in the connection. When `true`, the current Windows account credentials are used for authentication.
Recognized values are `true`, `false`, `yes`, `no`, and `sspi` (strongly recommended), which is equivalent to `true`.
If User ID and Password are specified and Integrated Security is set to true, the User ID and Password will be ignored and Integrated Security will be used.
is a more secure way to specify credentials for a connection that uses SQL Server Authentication (`Integrated Security=false`).|
|IP Address Preference
-or-
IPAddressPreference|IPv4First|The IP address family preference when establishing TCP connections. If `Transparent Network IP Resolution` (in .NET Framework) or `Multi Subnet Failover` is set to true, this setting has no effect. Supported values include:
`IPAddressPreference=IPv4First`
`IPAddressPreference=IPv6First`
`IPAddressPreference=UsePlatformDefault`|
diff --git a/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionEncryptOption.xml b/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionEncryptOption.xml
index f5f40255a3..35b8d24ab6 100644
--- a/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionEncryptOption.xml
+++ b/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionEncryptOption.xml
@@ -7,11 +7,36 @@
property. When converting from a boolean, a value of `true` converts to and a value of `false` converts to . When converting to a boolean, and convert to `true` and converts `false`.
+Implicit conversions have been added to maintain backwards compatibility with boolean behahavior for the property. When converting from a boolean, a value of `true` converts to and a value of `false` converts to . When converting to a boolean, , , and `null` convert to `true` and converts `false`.
]]>
+
+
+ Converts the specified string representation of a logical value to its equivalent.
+
+ A string containing the value to convert.
+
+ An object that is equivalent to contained in .
+
+
+ Throws exception if provided is not convertible to type.
+
+
+
+
+ Converts the specified string representation of a logical value to its equivalent and returns a value that indicates whether the conversion succeeded.
+
+ A string containing the value to convert.
+
+ An object that is equivalent to contained in . if conversion fails.
+
+
+ if the parameter was converted successfully; otherwise, .
+
+ This method does not throw an exception if conversion fails.
+ Specifies that TLS encryption is optional when connecting to the server. If the server requires encryption, encryption will be negotiated.
diff --git a/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml b/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml
index bb096150eb..82f7aa8ec9 100644
--- a/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml
+++ b/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml
@@ -481,6 +481,25 @@ This property corresponds to the "FailoverPartnerSPN" and "Failover Partner SPN"
+
+ Gets or sets the host name to use when validating the server certificate for the connection. When not specified, the server name from the `Data Source` is used for certificate validation. (Only available in v5.0+)
+
+ The value of the property, or if none has been supplied.
+
+
+
+ [!NOTE]
+> This property only applies when using `Encrypt` in or mode, otherwise it is ignored.
+
+ ]]>
+
+
+
To be added.
To be added.
@@ -787,7 +806,7 @@ Connections are considered the same if they have the same connection string. Dif
|Context Connection(Obsolete)|False|
|Current Language|Empty string|
|Data Source|Empty string|
-|Encrypt|False|
+|Encrypt|False in versions prior to 4.0, True in versions 4.0 and up|
|Enlist|True|
|Failover Partner|Empty string|
|Initial Catalog|Empty string|
@@ -842,6 +861,25 @@ Database = AdventureWorks
]]>
+
+ Gets or sets the path to a certificate file to match against the SQL Server TLS/SSL certificate for the connection. The accepted certificate formats are PEM, DER, and CER. If specified, the SQL Server certificate is checked by verifying if the `ServerCertificate` provided is an exact match. (Only available in v5.1+)
+
+ The value of the property, or if none has been supplied.
+
+
+
+ [!NOTE]
+> This property only applies when using `Encrypt` in or mode, otherwise it is ignored.
+
+ ]]>
+
+
+ Gets or sets the service principal name (SPN) of the data source.
diff --git a/doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml b/doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml
index 8a789962d3..b0ce159fbf 100644
--- a/doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml
+++ b/doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml
@@ -327,14 +327,14 @@
|||||
|-|-|-|-|
-|Boolean|Byte|Char|DateTime|
-|DateTimeOffset|Decimal|Double|Float|
-|Guid|Int16|Int32|Int64|
-|SqlBoolean|SqlByte|SqlDateTime|SqlDecimal|
-|SqlDouble|SqlGuid|SqlInt16|SqlInt32|
-|SqlInt64|SqlMoney|SqlSingle|SqlString|
-|Stream|String|TextReader|UDT, which can be any CLR type marked with .|
-|XmlReader||||
+|Boolean|Byte|Char|DateOnly (.NET 6 or later)|
+|DateTime|DateTimeOffset|Decimal|Double|
+|Float|Guid|Int16|Int32|
+|Int64|SqlBoolean|SqlByte|SqlDateTime|
+|SqlDecimal|SqlDouble|SqlGuid|SqlInt16|
+|SqlInt32|SqlInt64|SqlMoney|SqlSingle|
+|SqlString|Stream|String|TextReader|
+|TimeOnly (.NET 6 or later)|XmlReader||UDT, which can be any CLR type marked with .|
For more information, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
@@ -369,14 +369,14 @@
|||||
|-|-|-|-|
-|Boolean|Byte|Char|DateTime|
-|DateTimeOffset|Decimal|Double|Float|
-|Guid|Int16|Int32|Int64|
-|SqlBoolean|SqlByte|SqlDateTime|SqlDecimal|
-|SqlDouble|SqlGuid|SqlInt16|SqlInt32|
-|SqlInt64|SqlMoney|SqlSingle|SqlString|
-|Stream|String|TextReader|UDT, which can be any CLR type marked with .|
-|XmlReader||||
+|Boolean|Byte|Char|DateOnly (.NET 6 or later)|
+|DateTime|DateTimeOffset|Decimal|Double|
+|Float|Guid|Int16|Int32|
+|Int64|SqlBoolean|SqlByte|SqlDateTime|
+|SqlDecimal|SqlDouble|SqlGuid|SqlInt16|
+|SqlInt32|SqlInt64|SqlMoney|SqlSingle|
+|SqlString|Stream|String|TextReader|
+|TimeOnly (.NET 6 or later)|XmlReader||UDT, which can be any CLR type marked with .|
For more information, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
diff --git a/doc/snippets/Microsoft.Data.SqlClient/SqlRetryLogicBaseProvider.xml b/doc/snippets/Microsoft.Data.SqlClient/SqlRetryLogicBaseProvider.xml
index 9828d34437..031c2b1ff7 100644
--- a/doc/snippets/Microsoft.Data.SqlClient/SqlRetryLogicBaseProvider.xml
+++ b/doc/snippets/Microsoft.Data.SqlClient/SqlRetryLogicBaseProvider.xml
@@ -11,7 +11,7 @@
[IMPORTAMT!]
+> [IMPORTANT!]
> Don't block execution with a time consuming action when an event occurs. For instance, if you log data to a file, run it in a new thread to avoid blocking the main execution thread.
]]>
diff --git a/porting-cheat-sheet.md b/porting-cheat-sheet.md
index e27836717f..d09c16c77e 100644
--- a/porting-cheat-sheet.md
+++ b/porting-cheat-sheet.md
@@ -51,6 +51,7 @@ For .NET Framework projects it may be necessary to include the following in your
|--|--|
| Can use DateTime object as value for SqlParameter with type `DbType.Time`. | Must use TimeSpan object as value for SqlParameter with type `DbType.Time`. |
| Using DateTime object as value for SqlParameter with type `DbType.Date` would send date and time to SQL Server. | DateTime object's time components will be truncated when sent to SQL Server using `DbType.Date`. |
+| `Encrypt` defaults to `false`. | Starting in v4.0, default encryption settings were made more secure, requiring opt-in to non-encrypted connections. `Encrypt` defaults to `true` and the driver will always validate the server certificate based on `TrustServerCertificate`. (Previously, server certificates would only be validated if `Encrypt` was also `true`.)
If you need to turn off encryption, you must specify `Encrypt=false`. If you use encryption with a self-signed certificate on the server, you must specify `TrustServerCertificate=true`.
In v5.0, `SqlConnectionStringBuilder.Encrypt` is no longer a `bool`. It's a `SqlConnectionEncryptOption` with multiple values to support `Strict` encryption mode (TDS 8.0). It uses implicit conversion operators to remain code-backwards compatible, but it was a binary breaking change, requiring a recompile of applications. |
## Contribute to this Cheat Sheet
diff --git a/release-notes/2.1/2.1.5.md b/release-notes/2.1/2.1.5.md
new file mode 100644
index 0000000000..1617db1db9
--- /dev/null
+++ b/release-notes/2.1/2.1.5.md
@@ -0,0 +1,82 @@
+# Release Notes
+
+## Microsoft.Data.SqlClient 2.1.5 released 30 August 2022
+
+This update brings the below changes over the previous stable release:
+
+### Fixed
+
+- Added CommandText length validation when using stored procedure command types. [#1726](https://github.com/dotnet/SqlClient/pull/1726)
+- Fixed Kerberos authentication failure when using .NET 6. [#1727](https://github.com/dotnet/SqlClient/pull/1727)
+- Removed union overlay design and used reflection in `SqlTypeWorkarounds`. [#1729](https://github.com/dotnet/SqlClient/pull/1729)
+
+### Target Platform Support
+
+- .NET Framework 4.6+ (Windows x86, Windows x64)
+- .NET Core 2.1+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+- .NET Standard 2.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+
+### Ensure connections fail when encryption is required
+
+In scenarios where client encryption libraries were disabled or unavailable, it was possible for unencrypted connections to be made when Encrypt was set to true or the server required encryption.
+
+### Dependencies
+
+#### .NET Framework
+
+- Microsoft.Data.SqlClient.SNI 2.1.1
+- Microsoft.Identity.Client 4.21.1
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
+- Microsoft.IdentityModel.JsonWebTokens 6.8.0
+
+#### .NET Core 2.1
+
+- Microsoft.Data.SqlClient.SNI.runtime 2.1.1
+- Microsoft.Win32.Registry 4.7.0
+- System.Security.Principal.Windows 4.7.0
+- System.Text.Encoding.CodePages 4.7.0
+- System.Diagnostics.DiagnosticSource 4.7.0
+- System.Configuration.ConfigurationManager 4.7.0
+- System.Runtime.Caching 4.7.0
+- Microsoft.Identity.Client 4.21.1
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
+- Microsoft.IdentityModel.JsonWebTokens 6.8.0
+
+#### .NET Core 3.1
+
+- Microsoft.Data.SqlClient.SNI.runtime 2.1.1
+- Microsoft.Win32.Registry 4.7.0
+- System.Security.Principal.Windows 4.7.0
+- System.Text.Encoding.CodePages 4.7.0
+- System.Diagnostics.DiagnosticSource 4.7.0
+- System.Configuration.ConfigurationManager 4.7.0
+- System.Runtime.Caching 4.7.0
+- Microsoft.Identity.Client 4.21.1
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
+- Microsoft.IdentityModel.JsonWebTokens 6.8.0
+
+#### .NET Standard 2.0
+
+- Microsoft.Data.SqlClient.SNI.runtime 2.1.1
+- Microsoft.Win32.Registry 4.7.0
+- System.Buffers 4.5.1
+- System.Memory 4.5.4
+- System.Security.Principal.Windows 4.7.0
+- System.Text.Encoding.CodePages 4.7.0
+- System.Runtime.Caching 4.7.0
+- Microsoft.Identity.Client 4.21.1
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
+- Microsoft.IdentityModel.JsonWebTokens 6.8.0
+
+#### .NET Standard 2.1
+
+- Microsoft.Data.SqlClient.SNI.runtime 2.1.1
+- Microsoft.Win32.Registry 4.7.0
+- System.Buffers 4.5.1
+- System.Memory 4.5.4
+- System.Security.Principal.Windows 4.7.0
+- System.Text.Encoding.CodePages 4.7.0
+- System.Runtime.Caching 4.7.0
+- Microsoft.Identity.Client 4.21.1
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
+- Microsoft.IdentityModel.JsonWebTokens 6.8.0
diff --git a/release-notes/2.1/2.1.md b/release-notes/2.1/2.1.md
index e35a6f987b..2c149e041b 100644
--- a/release-notes/2.1/2.1.md
+++ b/release-notes/2.1/2.1.md
@@ -4,6 +4,7 @@ The following Microsoft.Data.SqlClient 2.1 stable releases have been shipped:
| Release Date | Version | Notes |
| :-- | :-- | :--: |
+| 2022/08/30 | 2.1.5 | [release notes](2.1.5.md) |
| 2021/09/20 | 2.1.4 | [release notes](2.1.4.md) |
| 2021/05/21 | 2.1.3 | [release notes](2.1.3.md) |
| 2021/03/03 | 2.1.2 | [release notes](2.1.2.md) |
diff --git a/release-notes/2.1/README.md b/release-notes/2.1/README.md
index e35a6f987b..2c149e041b 100644
--- a/release-notes/2.1/README.md
+++ b/release-notes/2.1/README.md
@@ -4,6 +4,7 @@ The following Microsoft.Data.SqlClient 2.1 stable releases have been shipped:
| Release Date | Version | Notes |
| :-- | :-- | :--: |
+| 2022/08/30 | 2.1.5 | [release notes](2.1.5.md) |
| 2021/09/20 | 2.1.4 | [release notes](2.1.4.md) |
| 2021/05/21 | 2.1.3 | [release notes](2.1.3.md) |
| 2021/03/03 | 2.1.2 | [release notes](2.1.2.md) |
diff --git a/release-notes/3.1/3.1.1.md b/release-notes/3.1/3.1.1.md
new file mode 100644
index 0000000000..d7cb669712
--- /dev/null
+++ b/release-notes/3.1/3.1.1.md
@@ -0,0 +1,77 @@
+# Release Notes
+
+## Microsoft.Data.SqlClient 3.1.1 released 12 August 2022
+
+This update brings the below changes over the previous release:
+
+### Fixed
+
+- Fixed null SqlBinary as rowversion. [#1700](https://github.com/dotnet/SqlClient/pull/1700)
+- Fixed Kerberos authentication failure when using .NET 6. [#1696](https://github.com/dotnet/SqlClient/pull/1696)
+- Fixed NullReferenceException during Azure Active Directory authentication. [#1695](https://github.com/dotnet/SqlClient/pull/1695)
+- Removed union overlay design and use reflection in `SqlTypeWorkarounds`. [#1699](https://github.com/dotnet/SqlClient/pull/1699)
+
+## Target Platform Support
+
+- .NET Framework 4.6+ (Windows x86, Windows x64)
+- .NET Core 2.1+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+- .NET Standard 2.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+
+### Dependencies
+
+#### .NET Framework 4.61
+
+- Microsoft.Data.SqlClient.SNI 3.0.0
+- Azure.Identity 1.3.0
+- Microsoft.Identity.Client 4.14.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
+- Microsoft.IdentityModel.JsonWebTokens 5.6.0
+- System.Configuration.ConfigurationManager 4.7.0
+- System.Text.Encodings.Web 4.7.2
+
+#### .NET Core 2.1
+
+- Microsoft.Data.SqlClient.SNI.runtime 3.0.0
+- Microsoft.Win32.Registry 4.7.0
+- System.Security.Principal.Windows 4.7.0
+- System.Text.Encoding.CodePages 4.7.0
+- System.Text.Encodings.Web 4.7.2
+- System.Diagnostics.DiagnosticSource 4.7.0
+- System.Configuration.ConfigurationManager 4.7.0
+- System.Runtime.Caching 4.7.0
+- Azure.Identity 1.3.0
+- Microsoft.Identity.Client 4.14.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
+- Microsoft.IdentityModel.JsonWebTokens 5.6.0
+
+#### .NET Core 3.1
+
+- Microsoft.Data.SqlClient.SNI.runtime 3.0.0
+- Microsoft.Win32.Registry 4.7.0
+- System.Security.Principal.Windows 4.7.0
+- System.Text.Encoding.CodePages 4.7.0
+- System.Text.Encodings.Web 4.7.2
+- System.Diagnostics.DiagnosticSource 4.7.0
+- System.Configuration.ConfigurationManager 4.7.0
+- System.Runtime.Caching 4.7.0
+- Azure.Identity 1.3.0
+- Microsoft.Identity.Client 4.14.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
+- Microsoft.IdentityModel.JsonWebTokens 5.6.0
+
+#### .NET Standard
+
+- Microsoft.Data.SqlClient.SNI.runtime 3.0.0
+- Microsoft.Win32.Registry 4.7.0
+- System.Buffers 4.5.1
+- System.Memory 4.5.4
+- System.Security.Principal.Windows 4.7.0
+- System.Text.Encoding.CodePages 4.7.0
+- System.Text.Encodings.Web 4.7.2
+- System.Runtime.Caching 4.7.0
+- Azure.Identity 1.3.0
+- Microsoft.Identity.Client 4.14.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
+- Microsoft.IdentityModel.JsonWebTokens 5.6.0
+- System.Configuration.ConfigurationManager 4.7.0
+- System.Runtime.Loader 4.3.0
diff --git a/release-notes/3.1/3.1.md b/release-notes/3.1/3.1.md
index d6a478c0ef..6e4d68e534 100644
--- a/release-notes/3.1/3.1.md
+++ b/release-notes/3.1/3.1.md
@@ -4,4 +4,5 @@ The following Microsoft.Data.SqlClient 3.1 stable releases have been shipped:
| Release Date | Version | Notes |
| :-- | :-- | :--: |
+| 2022/08/12 | 3.1.1 | [release notes](3.1.1.md) |
| 2022/03/30 | 3.1.0 | [release notes](3.1.0.md) |
diff --git a/release-notes/3.1/README.md b/release-notes/3.1/README.md
index d6a478c0ef..6e4d68e534 100644
--- a/release-notes/3.1/README.md
+++ b/release-notes/3.1/README.md
@@ -4,4 +4,5 @@ The following Microsoft.Data.SqlClient 3.1 stable releases have been shipped:
| Release Date | Version | Notes |
| :-- | :-- | :--: |
+| 2022/08/12 | 3.1.1 | [release notes](3.1.1.md) |
| 2022/03/30 | 3.1.0 | [release notes](3.1.0.md) |
diff --git a/release-notes/4.0/4.0.2.md b/release-notes/4.0/4.0.2.md
new file mode 100644
index 0000000000..96c485a613
--- /dev/null
+++ b/release-notes/4.0/4.0.2.md
@@ -0,0 +1,80 @@
+# Release Notes
+
+## Microsoft.Data.SqlClient 4.0.2 released 13 September 2022
+
+This update brings the below changes over the previous preview release:
+
+### Fixed
+
+- Fixed connection failure by not requiring Certificate Revocation List (CRL) check during authentication. [#1718](https://github.com/dotnet/SqlClient/pull/1718)
+- Parallelize SSRP requests on Linux and macOS when MultiSubNetFailover is specified. [#1720](https://github.com/dotnet/SqlClient/pull/1720), [#1747](https://github.com/dotnet/SqlClient/pull/1747)
+- Added CommandText length validation when using stored procedure command types. [#1721](https://github.com/dotnet/SqlClient/pull/1721)
+- Fixed NullReferenceException during Azure Active Directory authentication. [#1722](https://github.com/dotnet/SqlClient/pull/1722)
+- Fixed null SqlBinary as rowversion. [#1724](https://github.com/dotnet/SqlClient/pull/1724)
+- Fixed table's collation overriding with default UTF8 collation. [#1750](https://github.com/dotnet/SqlClient/pull/1750)
+
+## Changed
+
+- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `v4.0.1` [#1754](https://github.com/dotnet/SqlClient/pull/1754), which includes the fix for AppDomain crash introducing in issue [#1418](https://github.com/dotnet/SqlClient/issues/1418)
+- Various code improvements: [#1723](https://github.com/dotnet/SqlClient/pull/1723)
+
+## Target Platform Support
+
+- .NET Framework 4.6.1+ (Windows x86, Windows x64)
+- .NET Core 3.1+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+- .NET Standard 2.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+
+### Dependencies
+
+#### .NET Framework
+
+- Microsoft.Data.SqlClient.SNI 4.0.1
+- Azure.Identity 1.3.0
+- Microsoft.Identity.Client 4.22.0
+- Microsoft.IdentityModel.JsonWebTokens 6.8.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 5.0.0
+- System.IO 4.3.0
+- System.Runtime.InteropServices.RuntimeInformation 4.3.0
+- System.Security.Cryptography.Algorithms 4.3.1
+- System.Security.Cryptography.Primitives 4.3.0
+- System.Text.Encodings.Web 4.7.2
+
+#### .NET Core
+
+- Microsoft.Data.SqlClient.SNI.runtime 4.0.1
+- Azure.Identity 1.3.0
+- Microsoft.Identity.Client 4.22.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
+- Microsoft.IdentityModel.JsonWebTokens 6.8.0
+- Microsoft.Win32.Registry 5.0.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 5.0.0
+- System.Diagnostics.DiagnosticSource 5.0.0
+- System.IO 4.3.0
+- System.Runtime.Caching 5.0.0
+- System.Text.Encoding.CodePages 5.0.0
+- System.Text.Encodings.Web 4.7.2
+- System.Resources.ResourceManager 4.3.0
+- System.Security.Cryptography.Cng 5.0.0
+- System.Security.Principal.Windows 5.0.0
+
+#### .NET Standard
+
+- Microsoft.Data.SqlClient.SNI.runtime 4.0.1
+- Azure.Identity 1.3.0
+- Microsoft.Identity.Client 4.22.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
+- Microsoft.IdentityModel.JsonWebTokens 6.8.0
+- Microsoft.Win32.Registry 5.0.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 5.0.0
+- System.IO 4.3.0
+- System.Runtime.Caching 5.0.0
+- System.Text.Encoding.CodePages 5.0.0
+- System.Text.Encodings.Web 4.7.2
+- System.Resources.ResourceManager 4.3.0
+- System.Runtime.Loader 4.3.0
+- System.Security.Cryptography.Cng 5.0.0
+- System.Security.Principal.Windows 5.0.0
diff --git a/release-notes/4.0/4.0.md b/release-notes/4.0/4.0.md
index c6a93a0724..8d0ffeceb8 100644
--- a/release-notes/4.0/4.0.md
+++ b/release-notes/4.0/4.0.md
@@ -4,6 +4,7 @@ The following Microsoft.Data.SqlClient 4.0 stable releases have been shipped:
| Release Date | Version | Notes |
| :-- | :-- | :--: |
+| 2022/09/13 | 4.0.2 | [release notes](4.0.2.md) |
| 2022/01/17 | 4.0.1 | [release notes](4.0.1.md) |
| 2021/11/18 | 4.0.0 | [release notes](4.0.0.md) |
diff --git a/release-notes/4.0/README.md b/release-notes/4.0/README.md
index c6a93a0724..8d0ffeceb8 100644
--- a/release-notes/4.0/README.md
+++ b/release-notes/4.0/README.md
@@ -4,6 +4,7 @@ The following Microsoft.Data.SqlClient 4.0 stable releases have been shipped:
| Release Date | Version | Notes |
| :-- | :-- | :--: |
+| 2022/09/13 | 4.0.2 | [release notes](4.0.2.md) |
| 2022/01/17 | 4.0.1 | [release notes](4.0.1.md) |
| 2021/11/18 | 4.0.0 | [release notes](4.0.0.md) |
diff --git a/release-notes/4.1/4.1.1.md b/release-notes/4.1/4.1.1.md
new file mode 100644
index 0000000000..f6fbc70f19
--- /dev/null
+++ b/release-notes/4.1/4.1.1.md
@@ -0,0 +1,80 @@
+# Release Notes
+
+## Microsoft.Data.SqlClient 4.1.1 released 13 September 2022
+
+This update brings the below changes over the previous preview release:
+
+### Fixed
+
+- Fixed connection failure by not requiring Certificate Revocation List (CRL) check during authentication. [#1706](https://github.com/dotnet/SqlClient/pull/1706)
+- Parallelize SSRP requests on Linux and macOS when MultiSubNetFailover is specified. [#1708](https://github.com/dotnet/SqlClient/pull/1708), [#1746](https://github.com/dotnet/SqlClient/pull/1746)
+- Added CommandText length validation when using stored procedure command types. [#1709](https://github.com/dotnet/SqlClient/pull/1709)
+- Fixed NullReferenceException during Azure Active Directory authentication. [#1710](https://github.com/dotnet/SqlClient/pull/1710)
+- Fixed null SqlBinary as rowversion. [#1712](https://github.com/dotnet/SqlClient/pull/1712)
+- Fixed table's collation overriding with default UTF8 collation. [#1749](https://github.com/dotnet/SqlClient/pull/1749)
+
+## Changed
+
+- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `v4.0.1` [#1755](https://github.com/dotnet/SqlClient/pull/1755), which includes the fix for AppDomain crash introducing in issue [#1418](https://github.com/dotnet/SqlClient/issues/1418)
+- Various code improvements: [#1711](https://github.com/dotnet/SqlClient/pull/1711)
+
+## Target Platform Support
+
+- .NET Framework 4.6.1+ (Windows x86, Windows x64)
+- .NET Core 3.1+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+- .NET Standard 2.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+
+### Dependencies
+
+#### .NET Framework
+
+- Microsoft.Data.SqlClient.SNI 4.0.1
+- Azure.Identity 1.3.0
+- Microsoft.Identity.Client 4.22.0
+- Microsoft.IdentityModel.JsonWebTokens 6.8.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 5.0.0
+- System.IO 4.3.0
+- System.Runtime.InteropServices.RuntimeInformation 4.3.0
+- System.Security.Cryptography.Algorithms 4.3.1
+- System.Security.Cryptography.Primitives 4.3.0
+- System.Text.Encodings.Web 4.7.2
+
+#### .NET Core
+
+- Microsoft.Data.SqlClient.SNI.runtime 4.0.1
+- Azure.Identity 1.3.0
+- Microsoft.Identity.Client 4.22.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
+- Microsoft.IdentityModel.JsonWebTokens 6.8.0
+- Microsoft.Win32.Registry 5.0.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 5.0.0
+- System.Diagnostics.DiagnosticSource 5.0.0
+- System.IO 4.3.0
+- System.Runtime.Caching 5.0.0
+- System.Text.Encoding.CodePages 5.0.0
+- System.Text.Encodings.Web 4.7.2
+- System.Resources.ResourceManager 4.3.0
+- System.Security.Cryptography.Cng 5.0.0
+- System.Security.Principal.Windows 5.0.0
+
+#### .NET Standard
+
+- Microsoft.Data.SqlClient.SNI.runtime 4.0.1
+- Azure.Identity 1.3.0
+- Microsoft.Identity.Client 4.22.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
+- Microsoft.IdentityModel.JsonWebTokens 6.8.0
+- Microsoft.Win32.Registry 5.0.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 5.0.0
+- System.IO 4.3.0
+- System.Runtime.Caching 5.0.0
+- System.Text.Encoding.CodePages 5.0.0
+- System.Text.Encodings.Web 4.7.2
+- System.Resources.ResourceManager 4.3.0
+- System.Runtime.Loader 4.3.0
+- System.Security.Cryptography.Cng 5.0.0
+- System.Security.Principal.Windows 5.0.0
\ No newline at end of file
diff --git a/release-notes/4.1/4.1.md b/release-notes/4.1/4.1.md
index 86560228d7..a310caa5f7 100644
--- a/release-notes/4.1/4.1.md
+++ b/release-notes/4.1/4.1.md
@@ -4,4 +4,5 @@ The following Microsoft.Data.SqlClient 4.1 stable releases have been shipped:
| Release Date | Version | Notes |
| :-- | :-- | :--: |
+| 2022/09/13 | 4.1.1 | [release notes](4.1.1.md) |
| 2022/01/31 | 4.1.0 | [release notes](4.1.0.md) |
diff --git a/release-notes/4.1/README.md b/release-notes/4.1/README.md
index 86560228d7..a310caa5f7 100644
--- a/release-notes/4.1/README.md
+++ b/release-notes/4.1/README.md
@@ -4,4 +4,5 @@ The following Microsoft.Data.SqlClient 4.1 stable releases have been shipped:
| Release Date | Version | Notes |
| :-- | :-- | :--: |
+| 2022/09/13 | 4.1.1 | [release notes](4.1.1.md) |
| 2022/01/31 | 4.1.0 | [release notes](4.1.0.md) |
diff --git a/release-notes/5.0/5.0.0.md b/release-notes/5.0/5.0.0.md
index ecc981ce64..1bf0f071c5 100644
--- a/release-notes/5.0/5.0.0.md
+++ b/release-notes/5.0/5.0.0.md
@@ -142,7 +142,7 @@ Switch.Microsoft.Data.SqlClient.SuppressInsecureTLSWarning
#### .NET Framework
-- Microsoft.Data.SqlClient.SNI.runtime 5.0.0
+- Microsoft.Data.SqlClient.SNI 5.0.0
- Azure.Identity 1.6.0
- Microsoft.Identity.Client 4.45.0
- Microsoft.IdentityModel.JsonWebTokens 6.21.0
diff --git a/release-notes/5.0/5.0.1.md b/release-notes/5.0/5.0.1.md
new file mode 100644
index 0000000000..39d36cc579
--- /dev/null
+++ b/release-notes/5.0/5.0.1.md
@@ -0,0 +1,81 @@
+# Release Notes
+
+## Microsoft.Data.SqlClient 5.0.1 released 7 October 2022
+
+This update includes the following changes over the 5.0.0 release:
+
+### Fixed
+
+- Fixed missing `HostNameInCertificate` connection string property in .NET Framework. [#1782](https://github.com/dotnet/SqlClient/pull/1782)
+- Fixed async deadlock issue when sending attention fails due to network failure. [#1783](https://github.com/dotnet/SqlClient/pull/1783)
+- Fixed **Null Reference Exception** on assigning `null` to `SqlConnectionStringBuilder.Encrypt`. [#1784](https://github.com/dotnet/SqlClient/pull/1784)
+- Fixed `ReadAsync()` behavior to register Cancellation token action before streaming results. [#1785](https://github.com/dotnet/SqlClient/pull/1785)
+- Fixed hang on infinite timeout and managed SNI. [#1798](https://github.com/dotnet/SqlClient/pull/1798)
+- Fixed Default UTF8 collation conflict. [#1799](https://github.com/dotnet/SqlClient/pull/1799)
+
+### Changed
+
+- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `5.0.1` [#1795](https://github.com/dotnet/SqlClient/pull/1795), which includes the fix for AppDomain crash introducing in issue [#1418](https://github.com/dotnet/SqlClient/issues/1418).
+
+## Target Platform Support
+
+- .NET Framework 4.6.2+ (Windows x86, Windows x64)
+- .NET Core 3.1+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+- .NET Standard 2.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+
+### Dependencies
+
+#### .NET Framework
+
+- Microsoft.Data.SqlClient.SNI 5.0.1
+- Azure.Identity 1.6.0
+- Microsoft.Identity.Client 4.45.0
+- Microsoft.IdentityModel.JsonWebTokens 6.21.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.21.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 5.0.0
+- System.IO 4.3.0
+- System.Runtime.InteropServices.RuntimeInformation 4.3.0
+- System.Security.Cryptography.Algorithms 4.3.1
+- System.Security.Cryptography.Primitives 4.3.0
+- System.Text.Encoding.Web 4.7.2
+
+#### .NET Core
+
+- Microsoft.Data.SqlClient.SNI.runtime 5.0.1
+- Azure.Identity 1.6.0
+- Microsoft.Identity.Client 4.45.0
+- Microsoft.IdentityModel.JsonWebTokens 6.21.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.21.0
+- Microsoft.SqlServer.Server 1.0.0
+- Microsoft.Win32.Registry 5.0.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 5.0.0
+- System.Diagnostics.DiagnosticSource 5.0.0
+- System.IO 4.3.0
+- System.Runtime.Caching 5.0.0
+- System.Text.Encoding.CodePages 5.0.0
+- System.Text.Encodings.Web 4.7.2
+- System.Resources.ResourceManager 4.3.0
+- System.Security.Cryptography.Cng 5.0.0
+- System.Security.Principal.Windows 5.0.0
+
+#### .NET Standard
+
+- Microsoft.Data.SqlClient.SNI.runtime 5.0.1
+- Azure.Identity 1.6.0
+- Microsoft.Identity.Client 4.45.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.21.0
+- Microsoft.IdentityModel.JsonWebTokens 6.21.0
+- Microsoft.SqlServer.Server 1.0.0
+- Microsoft.Win32.Registry 5.0.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 5.0.0
+- System.IO 4.3.0
+- System.Runtime.Caching 5.0.0
+- System.Text.Encoding.CodePages 5.0.0
+- System.Text.Encodings.Web 4.7.2
+- System.Runtime.Loader 4.3.0
+- System.Resources.ResourceManager 4.3.0
+- System.Security.Cryptography.Cng 5.0.0
+- System.Security.Principal.Windows 5.0.0
diff --git a/release-notes/5.0/5.0.md b/release-notes/5.0/5.0.md
index 6fa437317c..ec3dbc7eb6 100644
--- a/release-notes/5.0/5.0.md
+++ b/release-notes/5.0/5.0.md
@@ -4,6 +4,7 @@ The following Microsoft.Data.SqlClient 5.0 stable releases have been shipped:
| Release Date | Version | Notes |
| :-- | :-- | :--: |
+| 2022/10/07 | 5.0.1 | [release notes](5.0.1.md) |
| 2022/08/05 | 5.0.0 | [release notes](5.0.0.md) |
The following Microsoft.Data.SqlClient 5.0 preview releases have been shipped:
diff --git a/release-notes/5.0/README.md b/release-notes/5.0/README.md
index 6fa437317c..ec3dbc7eb6 100644
--- a/release-notes/5.0/README.md
+++ b/release-notes/5.0/README.md
@@ -4,6 +4,7 @@ The following Microsoft.Data.SqlClient 5.0 stable releases have been shipped:
| Release Date | Version | Notes |
| :-- | :-- | :--: |
+| 2022/10/07 | 5.0.1 | [release notes](5.0.1.md) |
| 2022/08/05 | 5.0.0 | [release notes](5.0.0.md) |
The following Microsoft.Data.SqlClient 5.0 preview releases have been shipped:
diff --git a/release-notes/5.1/5.1.0-preview1.md b/release-notes/5.1/5.1.0-preview1.md
new file mode 100644
index 0000000000..222f10f7d5
--- /dev/null
+++ b/release-notes/5.1/5.1.0-preview1.md
@@ -0,0 +1,89 @@
+# Release Notes
+
+## Microsoft.Data.SqlClient 5.1.0-preview1.22279.3 released 19 October 2022
+
+This update brings the below changes over the previous release:
+
+### Fixed
+
+- Fixed `ReadAsync()` behavior to register Cancellation token action before streaming results. [#1781](https://github.com/dotnet/SqlClient/pull/1781)
+- Fixed `NullReferenceException` when assigning `null` to `SqlConnectionStringBuilder.Encrypt`. [#1778](https://github.com/dotnet/SqlClient/pull/1778)
+- Fixed missing `HostNameInCertificate` property in .NET Framework Reference Project. [#1776](https://github.com/dotnet/SqlClient/pull/1776)
+- Fixed async deadlock issue when sending attention fails due to network failure. [#1766](https://github.com/dotnet/SqlClient/pull/1766)
+- Fixed failed connection requests in ConnectionPool in case of PoolBlock. [#1768](https://github.com/dotnet/SqlClient/pull/1768)
+- Fixed hang on infinite timeout and managed SNI. [#1742](https://github.com/dotnet/SqlClient/pull/1742)
+- Fixed Default UTF8 collation conflict. [#1739](https://github.com/dotnet/SqlClient/pull/1739)
+
+### Changed
+
+- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `5.1.0-preview1.22278.1`. [#1787](https://github.com/dotnet/SqlClient/pull/1787) which includes TLS 1.3 Support and fix for AppDomain crash in issue [#1418](https://github.com/dotnet/SqlClient/issues/1418)
+- Changed the `SqlConnectionEncryptOption` string parser to public. [#1771](https://github.com/dotnet/SqlClient/pull/1771)
+- Converted `ExecuteNonQueryAsync` to use async context object. [#1692](https://github.com/dotnet/SqlClient/pull/1692)
+- Code health improvements [#1604](https://github.com/dotnet/SqlClient/pull/1604) [#1598](https://github.com/dotnet/SqlClient/pull/1598) [#1595](https://github.com/dotnet/SqlClient/pull/1595) [#1443](https://github.com/dotnet/SqlClient/pull/1443)
+
+### Known issues
+
+- When using `Encrypt=Strict` with TLS v1.3, the TLS handshake occurs twice on initial connection on .NET Framework due to a timeout during the TLS handshake and a retry helper re-establishes the connection; however, on .NET Core, it will throw a `System.ComponentModel.Win32Exception (258): The wait operation timed out.` and is being investigated. If you're using Microsoft.Data.SqlClient with .NET Core on Windows 11, you will need to enable the managed SNI on Windows context switch using following statement `AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows", true);` to use TLS v1.3 or disabling TLS 1.3 from the registry by assigning `0` to the following `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client\Enabled` registry key and it'll use TLS v1.2 for the connection. This will be fixed in a future release.
+
+## Target Platform Support
+
+- .NET Framework 4.6.2+ (Windows x86, Windows x64)
+- .NET Core 3.1+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+- .NET Standard 2.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+
+### Dependencies
+
+#### .NET Framework
+
+- Microsoft.Data.SqlClient.SNI 5.1.0.preview1.22278.1
+- Azure.Identity 1.6.0
+- Microsoft.Identity.Client 4.45.0
+- Microsoft.IdentityModel.JsonWebTokens 6.21.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.21.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 5.0.0
+- System.IO 4.3.0
+- System.Runtime.InteropServices.RuntimeInformation 4.3.0
+- System.Security.Cryptography.Algorithms 4.3.1
+- System.Security.Cryptography.Primitives 4.3.0
+- System.Text.Encoding.Web 4.7.2
+
+#### .NET Core
+
+- Microsoft.Data.SqlClient.SNI 5.1.0.preview1.22278.1
+- Azure.Identity 1.6.0
+- Microsoft.Identity.Client 4.45.0
+- Microsoft.IdentityModel.JsonWebTokens 6.21.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.21.0
+- Microsoft.SqlServer.Server 1.0.0
+- Microsoft.Win32.Registry 5.0.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 5.0.0
+- System.Diagnostics.DiagnosticSource 5.0.0
+- System.IO 4.3.0
+- System.Runtime.Caching 5.0.0
+- System.Text.Encoding.CodePages 5.0.0
+- System.Text.Encodings.Web 4.7.2
+- System.Resources.ResourceManager 4.3.0
+- System.Security.Cryptography.Cng 5.0.0
+- System.Security.Principal.Windows 5.0.0
+
+#### .NET Standard
+
+- Microsoft.Data.SqlClient.SNI 5.1.0.preview1.22278.1
+- Azure.Identity 1.6.0
+- Microsoft.Identity.Client 4.45.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.21.0
+- Microsoft.IdentityModel.JsonWebTokens 6.21.0
+- Microsoft.SqlServer.Server 1.0.0
+- Microsoft.Win32.Registry 5.0.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 5.0.0
+- System.IO 4.3.0
+- System.Runtime.Caching 5.0.0
+- System.Text.Encoding.CodePages 5.0.0
+- System.Text.Encodings.Web 4.7.2
+- System.Runtime.Loader 4.3.0
+- System.Resources.ResourceManager 4.3.0
+- System.Security.Cryptography.Cng 5.0.0
+- System.Security.Principal.Windows 5.0.0
diff --git a/release-notes/5.1/5.1.0-preview2.md b/release-notes/5.1/5.1.0-preview2.md
new file mode 100644
index 0000000000..93b58078a0
--- /dev/null
+++ b/release-notes/5.1/5.1.0-preview2.md
@@ -0,0 +1,98 @@
+# Release Notes
+
+## Microsoft.Data.SqlClient 5.1.0-preview2.22314.2 released 10 November 2022
+
+This update brings the below changes over the previous release:
+
+### Breaking changes over preview release v5.1.0-preview1
+
+- Add support for .NET 6.0 and Dropped support for .NET Core 3.1. [#1704](https://github.com/dotnet/SqlClient/pull/1704) [#1823](https://github.com/dotnet/SqlClient/pull/1823)
+
+### Added
+
+- Added support for `DateOnly` and `TimeOnly` for `SqlParameter` value and `GetFieldValue`. [#1813](https://github.com/dotnet/SqlClient/pull/1813)
+- Added support for TLS 1.3 for .NET Core and SNI Native. [#1821](https://github.com/dotnet/SqlClient/pull/1821)
+- Added `ServerCertificate` support for `Encrypt=Mandatory` or `Encrypt=Strict`. [#1822](https://github.com/dotnet/SqlClient/pull/1822) [Read more](#server-certificate-support)
+- Added Windows ARM64 support when targeting .NET Framework. [#1828](https://github.com/dotnet/SqlClient/pull/1828)
+
+### Fixed
+
+- Fixed memory leak regression from [#1781](https://github.com/dotnet/SqlClient/pull/1781) using a `DisposableTemporaryOnStack` struct. [#1818](https://github.com/dotnet/SqlClient/pull/1818)
+
+### Changed
+
+- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `5.1.0-preview2.22311.2`. [#1831](https://github.com/dotnet/SqlClient/pull/1831) which includes the fix for the TLS 1.3 timeout and double handshake issue, removal of ARM32 binaries, and support for the `ServerCertificate` option. [#1822](https://github.com/dotnet/SqlClient/issues/1822) [Read more](#server-certificate-support)
+- Reverted "Excluding unsupported TLS protocols" for issue [#1151](https://github.com/dotnet/SqlClient/issues/1151) (i.e. removed `Switch.Microsoft.Data.SqlClient.EnableSecureProtocolsByOS`) by adding support for TLS 1.3. [#1824](https://github.com/dotnet/SqlClient/issues/1824)
+- Code health improvements [#1812](https://github.com/dotnet/SqlClient/pull/1812) [#1520](https://github.com/dotnet/SqlClient/pull/1520)
+
+## New features
+
+### Server Certificate Support
+The default value of the `ServerCertificate` connection setting is an empty string. When `Encrypt` is set to `Mandatory` or `Strict`, `ServerCertificate` can be used to specify a path on the file system to a certificate file to match against the SQL Server's TLS/SSL certificate. For this to be valid, the certificate specified must be an exact match. The accepted certificate formats are `PEM`, `DER`, and `CER`. Here is an usage example:
+
+ ```cs
+ "Data Source=...;Encrypt=Strict;ServerCertificate=C:\\certificates\\server.cer"
+ ```
+
+## Target Platform Support
+
+- .NET Framework 4.6.2+ (Windows x86, Windows x64)
+- .NET 6.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+- .NET Standard 2.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+
+### Dependencies
+
+#### .NET Framework
+
+- Microsoft.Data.SqlClient.SNI 5.1.0.preview2.22311.2
+- Azure.Identity 1.7.0
+- Microsoft.Identity.Client 4.47.2
+- Microsoft.IdentityModel.JsonWebTokens 6.24.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 6.0.1
+- System.IO 4.3.0
+- System.Runtime.InteropServices.RuntimeInformation 4.3.0
+- System.Security.Cryptography.Algorithms 4.3.1
+- System.Security.Cryptography.Primitives 4.3.0
+- System.Text.Encoding.Web 6.0.0
+
+#### .NET
+
+- Microsoft.Data.SqlClient.SNI 5.1.0.preview2.22311.2
+- Azure.Identity 1.7.0
+- Microsoft.Identity.Client 4.47.2
+- Microsoft.IdentityModel.JsonWebTokens 6.24.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
+- Microsoft.SqlServer.Server 1.0.0
+- Microsoft.Win32.Registry 5.0.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 6.0.1
+- System.Diagnostics.DiagnosticSource 6.0.0
+- System.IO 4.3.0
+- System.Runtime.Caching 6.0.0
+- System.Text.Encoding.CodePages 6.0.0
+- System.Text.Encodings.Web 6.0.0
+- System.Resources.ResourceManager 4.3.0
+- System.Security.Cryptography.Cng 5.0.0
+- System.Security.Principal.Windows 5.0.0
+
+#### .NET Standard
+
+- Microsoft.Data.SqlClient.SNI 5.1.0.preview2.22311.2
+- Azure.Identity 1.7.0
+- Microsoft.Identity.Client 4.47.2
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
+- Microsoft.IdentityModel.JsonWebTokens 6.24.0
+- Microsoft.SqlServer.Server 1.0.0
+- Microsoft.Win32.Registry 5.0.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 6.0.1
+- System.IO 4.3.0
+- System.Runtime.Caching 6.0.0
+- System.Text.Encoding.CodePages 6.0.0
+- System.Text.Encodings.Web 6.0.0
+- System.Runtime.Loader 4.3.0
+- System.Resources.ResourceManager 4.3.0
+- System.Security.Cryptography.Cng 5.0.0
+- System.Security.Principal.Windows 5.0.0
diff --git a/release-notes/5.1/5.1.0.md b/release-notes/5.1/5.1.0.md
new file mode 100644
index 0000000000..015b8966b9
--- /dev/null
+++ b/release-notes/5.1/5.1.0.md
@@ -0,0 +1,103 @@
+# Release Notes
+
+## Microsoft.Data.SqlClient 5.1.0 released 19 January 2023
+
+This update includes the following changes over the 5.0 release:
+
+### Breaking changes
+
+- Dropped support for .NET Core 3.1. [#1704](https://github.com/dotnet/SqlClient/pull/1704) [#1823](https://github.com/dotnet/SqlClient/pull/1823)
+
+### Added
+
+- Added support for .NET 6.0. [#1704](https://github.com/dotnet/SqlClient/pull/1704)
+- Added support for `DateOnly` and `TimeOnly` for `SqlParameter` value and `GetFieldValue`. [#1813](https://github.com/dotnet/SqlClient/pull/1813)
+- Added support for TLS 1.3 on .NET Core and native SNI. [#1821](https://github.com/dotnet/SqlClient/pull/1821)
+- Added `ServerCertificate` setting for `Encrypt=Mandatory` or `Encrypt=Strict`. [#1822](https://github.com/dotnet/SqlClient/pull/1822) [Read more](#server-certificate)
+- Added Windows ARM64 support when targeting .NET Framework. [#1828](https://github.com/dotnet/SqlClient/pull/1828)
+
+### Fixed
+
+- Fixed thread safety of transient error list in configurable retry logic. [#1882](https://github.com/dotnet/SqlClient/pull/1882)
+- Fixed deadlock when using SinglePhaseCommit with distributed transactions. [#1801](https://github.com/dotnet/SqlClient/pull/1801)
+- Fixed Dedicated Admin Connections (DAC) to localhost in managed SNI [#1865](https://github.com/dotnet/SqlClient/pull/1865)
+- Fixed memory leak regression from [#1781](https://github.com/dotnet/SqlClient/pull/1781) using a `DisposableTemporaryOnStack` struct. [#1818](https://github.com/dotnet/SqlClient/pull/1818)
+- Fixed `ReadAsync()` behavior to register Cancellation token action before streaming results. [#1781](https://github.com/dotnet/SqlClient/pull/1781)
+- Fixed `NullReferenceException` when assigning `null` to `SqlConnectionStringBuilder.Encrypt`. [#1778](https://github.com/dotnet/SqlClient/pull/1778)
+- Fixed missing `HostNameInCertificate` property in .NET Framework Reference Project. [#1776](https://github.com/dotnet/SqlClient/pull/1776)
+- Fixed async deadlock issue when sending attention fails due to network failure. [#1766](https://github.com/dotnet/SqlClient/pull/1766)
+- Fixed failed connection requests in ConnectionPool in case of PoolBlock. [#1768](https://github.com/dotnet/SqlClient/pull/1768)
+- Fixed hang on infinite timeout and managed SNI. [#1742](https://github.com/dotnet/SqlClient/pull/1742)
+- Fixed Default UTF8 collation conflict. [#1739](https://github.com/dotnet/SqlClient/pull/1739)
+
+### Changed
+
+- Updated `Microsoft.Data.SqlClient.SNI` (.NET Framework dependency) and `Microsoft.Data.SqlClient.SNI.runtime` (.NET Core/Standard dependency) version to `5.1.0`. [#1889](https://github.com/dotnet/SqlClient/pull/1889) which includes fix for AppDomain crash in issue [#1418](https://github.com/dotnet/SqlClient/issues/1418), TLS 1.3 Support, removal of ARM32 binaries, and support for the `ServerCertificate` option. [#1822](https://github.com/dotnet/SqlClient/issues/1822) [Read more](#server-certificate)
+- Reverted "Excluding unsupported TLS protocols" for issue [#1151](https://github.com/dotnet/SqlClient/issues/1151) (i.e. removed `Switch.Microsoft.Data.SqlClient.EnableSecureProtocolsByOS`) by adding support for TLS 1.3. [#1824](https://github.com/dotnet/SqlClient/issues/1824)
+- Changed the `SqlConnectionEncryptOption` string parser to public. [#1771](https://github.com/dotnet/SqlClient/pull/1771)
+- Converted `ExecuteNonQueryAsync` to use async context object. [#1692](https://github.com/dotnet/SqlClient/pull/1692)
+- Code health improvements [#1867](https://github.com/dotnet/SqlClient/pull/1867) [#1849](https://github.com/dotnet/SqlClient/pull/1849) [#1812](https://github.com/dotnet/SqlClient/pull/1812) [#1520](https://github.com/dotnet/SqlClient/pull/1520) [#1604](https://github.com/dotnet/SqlClient/pull/1604) [#1598](https://github.com/dotnet/SqlClient/pull/1598) [#1595](https://github.com/dotnet/SqlClient/pull/1595) [#1443](https://github.com/dotnet/SqlClient/pull/1443)
+
+## New features
+
+### Server Certificate
+
+The default value of the `ServerCertificate` connection setting is an empty string. When `Encrypt` is set to `Mandatory` or `Strict`, `ServerCertificate` can be used to specify a path on the file system to a certificate file to match against the SQL Server's TLS/SSL certificate. For this to be valid, the certificate specified must be an exact match. The accepted certificate formats are `PEM`, `DER`, and `CER`. Here is an example:
+
+ ```cs
+ "Data Source=...;Encrypt=Strict;ServerCertificate=C:\\certificates\\server.cer"
+ ```
+
+## Target Platform Support
+
+- .NET Framework 4.6.2+ (Windows x86, Windows x64)
+- .NET 6.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+- .NET Standard 2.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
+
+### Dependencies
+
+#### .NET Framework
+
+- Microsoft.Data.SqlClient.SNI 5.1.0
+- Azure.Identity 1.7.0
+- Microsoft.Identity.Client 4.47.2
+- Microsoft.IdentityModel.JsonWebTokens 6.24.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 6.0.1
+- System.Runtime.InteropServices.RuntimeInformation 4.3.0
+- System.Text.Encoding.Web 6.0.0
+
+#### .NET
+
+- Microsoft.Data.SqlClient.SNI 5.1.0
+- Azure.Identity 1.7.0
+- Microsoft.Identity.Client 4.47.2
+- Microsoft.IdentityModel.JsonWebTokens 6.24.0
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
+- Microsoft.SqlServer.Server 1.0.0
+- System.Configuration.ConfigurationManager 6.0.1
+- System.Diagnostics.DiagnosticSource 6.0.0
+- System.Runtime.Caching 6.0.0
+- System.Text.Encoding.CodePages 6.0.0
+- System.Text.Encodings.Web 6.0.0
+- System.Security.Cryptography.Cng 5.0.0
+- System.Security.Principal.Windows 5.0.0
+
+#### .NET Standard
+
+- Microsoft.Data.SqlClient.SNI 5.1.0
+- Azure.Identity 1.7.0
+- Microsoft.Identity.Client 4.47.2
+- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.24.0
+- Microsoft.IdentityModel.JsonWebTokens 6.24.0
+- Microsoft.SqlServer.Server 1.0.0
+- Microsoft.Win32.Registry 5.0.0
+- System.Buffers 4.5.1
+- System.Configuration.ConfigurationManager 6.0.1
+- System.Runtime.Caching 6.0.0
+- System.Text.Encoding.CodePages 6.0.0
+- System.Text.Encodings.Web 6.0.0
+- System.Runtime.Loader 4.3.0
+- System.Security.Cryptography.Cng 5.0.0
+- System.Security.Principal.Windows 5.0.0
diff --git a/release-notes/5.1/5.1.md b/release-notes/5.1/5.1.md
new file mode 100644
index 0000000000..6f6687b5d5
--- /dev/null
+++ b/release-notes/5.1/5.1.md
@@ -0,0 +1,14 @@
+# Microsoft.Data.SqlClient 5.1 Releases
+
+The following Microsoft.Data.SqlClient 5.1 stable releases have been shipped:
+
+| Release Date | Version | Notes |
+| :-- | :-- | :--: |
+| 2023/01/19 | 5.1.0 | [release notes](5.1.0.md) |
+
+The following Microsoft.Data.SqlClient 5.1 preview releases have been shipped:
+
+| Release Date | Version | Notes |
+| :-- | :-- | :--: |
+| 2022/11/10 | 5.1.0-preview2.22314.2 | [release notes](5.1.0-preview2.md) |
+| 2022/10/19 | 5.1.0-preview1.22279.3 | [release notes](5.1.0-preview1.md) |
diff --git a/release-notes/5.1/README.md b/release-notes/5.1/README.md
new file mode 100644
index 0000000000..6f6687b5d5
--- /dev/null
+++ b/release-notes/5.1/README.md
@@ -0,0 +1,14 @@
+# Microsoft.Data.SqlClient 5.1 Releases
+
+The following Microsoft.Data.SqlClient 5.1 stable releases have been shipped:
+
+| Release Date | Version | Notes |
+| :-- | :-- | :--: |
+| 2023/01/19 | 5.1.0 | [release notes](5.1.0.md) |
+
+The following Microsoft.Data.SqlClient 5.1 preview releases have been shipped:
+
+| Release Date | Version | Notes |
+| :-- | :-- | :--: |
+| 2022/11/10 | 5.1.0-preview2.22314.2 | [release notes](5.1.0-preview2.md) |
+| 2022/10/19 | 5.1.0-preview1.22279.3 | [release notes](5.1.0-preview1.md) |
diff --git a/release-notes/README.md b/release-notes/README.md
index cff1b6b88d..ba76fe8433 100644
--- a/release-notes/README.md
+++ b/release-notes/README.md
@@ -4,6 +4,7 @@ The latest stable release is [Microsoft.Data.SqlClient 5.0](5.0).
## Release Information
+- [Microsoft.Data.SqlClient 5.1](5.1)
- [Microsoft.Data.SqlClient 5.0](5.0)
- [Microsoft.Data.SqlClient 4.1](4.1)
- [Microsoft.Data.SqlClient 4.0](4.0)
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 bbc2efc19f..3f2267451e 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.AzureKeyVaultProviderAzureKeyVaultProvider{9073ABEF-92E0-4702-BB23-2C99CEF9BDD7}
- netcoreapp
- netfx
+ netcoreapp
+ netfxDebug;Release;AnyCPU;x86;x64$(ObjFolder)$(Configuration).$(Platform)\$(AddOnName)
diff --git a/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props b/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props
index d2d8fc7400..762c5f9ed8 100644
--- a/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props
+++ b/src/Microsoft.Data.SqlClient/add-ons/Directory.Build.props
@@ -18,7 +18,7 @@
net462netstandard2.0
- netcoreapp3.1
+ net6.0
@@ -36,7 +36,7 @@
netstandard2.0;netstandard2.1
- netcoreapp3.1
+ net6.0net462
diff --git a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs
index deb4ad0bf9..58dfd74e1e 100644
--- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs
@@ -474,7 +474,7 @@ public static partial class SqlClientMetaDataCollectionNames
///
public static readonly string StructuredTypeMembers;
}
-#if NETCOREAPP || NETSTANDARD21_AND_ABOVE
+#if NETCOREAPP || NETSTANDARD2_1_OR_GREATER
///
public enum SqlConnectionAttestationProtocol
{
@@ -506,6 +506,10 @@ public enum SqlConnectionIPAddressPreference
///
public sealed class SqlConnectionEncryptOption
{
+ ///
+ public static SqlConnectionEncryptOption Parse(string value) => throw null;
+ ///
+ public static bool TryParse(string value, out SqlConnectionEncryptOption result) => throw null;
///
public static SqlConnectionEncryptOption Optional => throw null;
@@ -1007,7 +1011,7 @@ public SqlConnectionStringBuilder(string connectionString) { }
[System.ComponentModel.DisplayNameAttribute("Data Source")]
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
public string DataSource { get { throw null; } set { } }
-#if NETCOREAPP || NETSTANDARD21_AND_ABOVE
+#if NETCOREAPP || NETSTANDARD2_1_OR_GREATER
///
[System.ComponentModel.DisplayNameAttribute("Attestation Protocol")]
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
@@ -1029,6 +1033,11 @@ public SqlConnectionStringBuilder(string connectionString) { }
[System.ComponentModel.DisplayNameAttribute("Host Name In Certificate")]
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
public string HostNameInCertificate { get { throw null; } set { } }
+ ///
+ [System.ComponentModel.DisplayNameAttribute("Server Certificate")]
+ [System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
+ public string ServerCertificate { get { throw null; } set { } }
+
///
[System.ComponentModel.DisplayNameAttribute("Enlist")]
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
@@ -1428,7 +1437,9 @@ internal SqlException() { }
///
public byte State { get { throw null; } }
///
+#if !NET6_0_OR_GREATER
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
+#endif
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) { }
///
public override string ToString() { throw null; }
@@ -1758,9 +1769,18 @@ protected override void Dispose(bool disposing) { }
///
public override void Rollback() { }
///
+#if NET6_0_OR_GREATER
+ public override void Rollback(string transactionName) { }
+#else
public void Rollback(string transactionName) { }
+#endif
+
///
+#if NET6_0_OR_GREATER
+ public override void Save(string savePointName) { }
+#else
public void Save(string savePointName) { }
+#endif
}
///
public sealed class SqlRetryingEventArgs : System.EventArgs
diff --git a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj
index 1b3863ec7e..41e1263abc 100644
--- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj
@@ -1,23 +1,17 @@
false
- netcoreapp3.1;netstandard2.0;netstandard2.1
+ net6.0;netstandard2.0;netstandard2.1netstandard2.1$(ObjFolder)$(Configuration)\$(AssemblyName)\ref\$(BinFolder)$(Configuration)\$(AssemblyName)\ref\$(OutputPath)\$(TargetFramework)\Microsoft.Data.SqlClient.xmlCore $(BaseProduct)Debug;Release;
- netcoreapp
- netstandard
+ netcoreapp
+ netstandardAnyCPU;x64;x86
-
- $(DefineConstants);NETSTANDARD21_AND_ABOVE
-
-
- $(DefineConstants);NETCOREAPP
-
@@ -31,4 +25,4 @@
-
\ No newline at end of file
+
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 eae47ef2f6..c8591a8c11 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Interop/SNINativeMethodWrapper.Windows.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Interop/SNINativeMethodWrapper.Windows.cs
@@ -51,6 +51,7 @@ internal struct AuthProviderInfo
public uint flags;
[MarshalAs(UnmanagedType.Bool)]
public bool tlsFirst;
+ public object certContext;
[MarshalAs(UnmanagedType.LPWStr)]
public string certId;
[MarshalAs(UnmanagedType.Bool)]
@@ -287,7 +288,7 @@ internal struct SNI_Error
private static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, out ProviderEnum provNum);
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
- private static extern uint SNIInitialize([In] bool useSystemDefaultSecureProtocols, [In] IntPtr pmo);
+ private static extern uint SNIInitialize([In] IntPtr pmo);
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
private static extern uint SNIOpenSyncExWrapper(ref SNI_CLIENT_CONSUMER_INFO pClientConsumerInfo, out IntPtr ppConn);
@@ -375,7 +376,7 @@ internal static uint SniGetConnectionIPString(SNIHandle pConn, ref string connIP
internal static uint SNIInitialize()
{
- return SNIInitialize(LocalAppContextSwitches.UseSystemDefaultSecureProtocols, IntPtr.Zero);
+ return SNIInitialize(IntPtr.Zero);
}
internal static unsafe uint SNIOpenMarsSession(ConsumerInfo consumerInfo, SNIHandle parent, ref IntPtr pConn, bool fSync, SqlConnectionIPAddressPreference ipPreference, SQLDNSInfo cachedDNSInfo)
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 5b72e28c18..5e08a713a5 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
@@ -1,7 +1,7 @@
Microsoft.Data.SqlClient
- netcoreapp3.1;netstandard2.0;netstandard2.1
+ net6.0;netstandard2.0;netstandard2.1netstandard2.1Microsoft.Data.SqlClient is not supported on this platform.$(OS)
@@ -9,8 +9,8 @@
truefalse
- netcoreapp
- netstandard
+ netcoreapp
+ netstandardDebug;Release;AnyCPU;x64;x86$(ObjFolder)$(Configuration).$(Platform)\$(AssemblyName)\netcore\
@@ -19,12 +19,6 @@
trueCore $(BaseProduct)
-
- $(DefineConstants);NETCOREAPP;
-
-
- $(DefineConstants);NETSTANDARD;
- portabletrue
@@ -115,6 +109,9 @@
Microsoft\Data\SqlClient\DataClassification\SensitivityClassification.cs
+
+ Microsoft\Data\SqlClient\DisposableTemporaryOnStack.cs
+
Microsoft\Data\SqlClient\EnclaveDelegate.cs
@@ -331,6 +328,9 @@
Microsoft\Data\SqlClient\SqlConnectionEncryptOption.cs
+
+ Microsoft\Data\SqlClient\SqlConnectionEncryptOptionConverter.cs
+
Microsoft\Data\SqlClient\SqlConnectionPoolGroupProviderInfo.cs
@@ -394,6 +394,9 @@
Microsoft\Data\SqlClient\SqlInfoMessageEventHandler.cs
+
+ Microsoft\Data\SqlClient\SqlInternalConnection.cs
+
Microsoft\Data\SqlClient\SqlInternalTransaction.cs
@@ -466,12 +469,18 @@
Microsoft\Data\SqlClient\TdsParameterSetter.cs
+
+ Microsoft\Data\SqlClient\TdsParserStateObject.cs
+
Microsoft\Data\SqlClient\TdsParserStaticMethods.cs
Microsoft\Data\SqlClient\TdsRecordBufferSetter.cs
+
+ Microsoft\Data\SqlClient\TdsParserSessionPool.cs
+
Microsoft\Data\SqlClient\TdsValueSetter.cs
@@ -634,14 +643,12 @@
-
-
@@ -660,6 +667,9 @@
+
+ Microsoft\Data\SqlClient\TdsParserSafeHandles.Windows.cs
+
@@ -745,7 +755,6 @@
-
@@ -944,7 +953,7 @@
-
+
@@ -959,12 +968,10 @@
-
-
-
+
-
+
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.NetCoreApp.cs
index 11c153e5b3..c85d042b2a 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.NetCoreApp.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.NetCoreApp.cs
@@ -11,14 +11,6 @@ namespace Microsoft.Data.ProviderBase
{
sealed internal partial class DbConnectionPool
{
- partial void CheckPoolBlockingPeriod(Exception e)
- {
- if (!IsBlockingPeriodEnabled())
- {
- throw e;
- }
- }
-
private bool IsBlockingPeriodEnabled()
{
var poolGroupConnectionOptions = _connectionPoolGroup.ConnectionOptions as SqlConnectionString;
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.cs
index c6f5a39693..7858adc93c 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.cs
@@ -776,7 +776,12 @@ private DbConnectionInternal CreateObject(DbConnection owningObject, DbConnectio
throw;
}
- CheckPoolBlockingPeriod(e);
+#if NETCOREAPP
+ if (!IsBlockingPeriodEnabled())
+ {
+ throw;
+ }
+#endif
// Close associated Parser if connection already established.
if (newObj?.IsConnectionAlive() == true)
@@ -824,9 +829,6 @@ private DbConnectionInternal CreateObject(DbConnection owningObject, DbConnectio
return newObj;
}
- //This method is implemented in DbConnectionPool.NetCoreApp
- partial void CheckPoolBlockingPeriod(Exception e);
-
private void DeactivateObject(DbConnectionInternal obj)
{
SqlClientEventSource.Log.TryPoolerTraceEvent(" {0}, Connection {1}, Deactivating.", ObjectID, obj.ObjectID);
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/AAsyncCallContext.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/AAsyncCallContext.cs
index 56e369593a..76710ff980 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/AAsyncCallContext.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/AAsyncCallContext.cs
@@ -17,38 +17,68 @@ namespace Microsoft.Data.SqlClient
// CONSIDER creating your own Set method that calls the base Set rather than providing a parameterized ctor, it is friendlier to caching
// DO NOT use this class' state after Dispose has been called. It will not throw ObjectDisposedException but it will be a cleared object
- internal abstract class AAsyncCallContext : IDisposable
+ internal abstract class AAsyncCallContext : AAsyncBaseCallContext
where TOwner : class
+ where TDisposable : IDisposable
{
- protected TOwner _owner;
- protected TaskCompletionSource _source;
- protected IDisposable _disposable;
+ protected TDisposable _disposable;
protected AAsyncCallContext()
{
}
- protected AAsyncCallContext(TOwner owner, TaskCompletionSource source, IDisposable disposable = null)
+ protected AAsyncCallContext(TOwner owner, TaskCompletionSource source, TDisposable disposable = default)
{
Set(owner, source, disposable);
}
- protected void Set(TOwner owner, TaskCompletionSource source, IDisposable disposable = null)
+ protected void Set(TOwner owner, TaskCompletionSource source, TDisposable disposable = default)
+ {
+ base.Set(owner, source);
+ _disposable = disposable;
+ }
+
+ protected override void DisposeCore()
+ {
+ TDisposable copyDisposable = _disposable;
+ _disposable = default;
+ copyDisposable?.Dispose();
+ }
+ }
+
+ internal abstract class AAsyncBaseCallContext
+ {
+ protected TOwner _owner;
+ protected TaskCompletionSource _source;
+ protected bool _isDisposed;
+
+ protected AAsyncBaseCallContext()
+ {
+ }
+
+ protected void Set(TOwner owner, TaskCompletionSource source)
{
_owner = owner ?? throw new ArgumentNullException(nameof(owner));
_source = source ?? throw new ArgumentNullException(nameof(source));
- _disposable = disposable;
+ _isDisposed = false;
}
protected void ClearCore()
{
_source = null;
_owner = default;
- IDisposable copyDisposable = _disposable;
- _disposable = null;
- copyDisposable?.Dispose();
+ try
+ {
+ DisposeCore();
+ }
+ finally
+ {
+ _isDisposed = true;
+ }
}
+ protected abstract void DisposeCore();
+
///
/// override this method to cleanup instance data before ClearCore is called which will blank the base data
///
@@ -65,16 +95,19 @@ protected virtual void AfterCleared(TOwner owner)
public void Dispose()
{
- TOwner owner = _owner;
- try
- {
- Clear();
- }
- finally
+ if (!_isDisposed)
{
- ClearCore();
+ TOwner owner = _owner;
+ try
+ {
+ Clear();
+ }
+ finally
+ {
+ ClearCore();
+ }
+ AfterCleared(owner);
}
- AfterCleared(owner);
}
}
}
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/LocalDB.Windows.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/LocalDB.Windows.cs
index 68eaa25486..a81fb89dfb 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/LocalDB.Windows.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/LocalDB.Windows.cs
@@ -50,8 +50,14 @@ private string GetConnectionString(string localDbInstance)
{
StringBuilder localDBConnectionString = new StringBuilder(MAX_LOCAL_DB_CONNECTION_STRING_SIZE + 1);
int sizeOfbuffer = localDBConnectionString.Capacity;
- localDBStartInstanceFunc(localDbInstance, 0, localDBConnectionString, ref sizeOfbuffer);
- return localDBConnectionString.ToString();
+ int result = localDBStartInstanceFunc(localDbInstance, 0, localDBConnectionString, ref sizeOfbuffer);
+ if (result != TdsEnums.SNI_SUCCESS)
+ {
+ SNILoadHandle.SingletonInstance.LastError = new SNIError(SNIProviders.INVALID_PROV, 0, SNICommon.LocalDBErrorCode, Strings.SNI_ERROR_50);
+ SqlClientEventSource.Log.TrySNITraceEvent(nameof(LocalDB), EventType.ERR, "Unsuccessful 'LocalDBStartInstance' method call with {0} result to start '{1}' localDb instance", args0: result, args1: localDbInstance);
+ localDBConnectionString = null;
+ }
+ return localDBConnectionString?.ToString();
}
internal enum LocalDBErrorState
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs
index 6980eb09f2..08272596d8 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs
@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System;
+using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
@@ -20,16 +21,18 @@ namespace Microsoft.Data.SqlClient.SNI
///
internal enum SNIProviders
{
- HTTP_PROV, // HTTP Provider
- NP_PROV, // Named Pipes Provider
- SESSION_PROV, // Session Provider
- SIGN_PROV, // Sign Provider
- SM_PROV, // Shared Memory Provider
- SMUX_PROV, // SMUX Provider
- SSL_PROV, // SSL Provider
- TCP_PROV, // TCP Provider
- MAX_PROVS, // Number of providers
- INVALID_PROV // SQL Network Interfaces
+ HTTP_PROV = 0, // HTTP Provider
+ NP_PROV = 1, // Named Pipes Provider
+ SESSION_PROV = 2, // Session Provider
+ SIGN_PROV = 3, // Sign Provider
+ SM_PROV = 4, // Shared Memory Provider
+ SMUX_PROV = 5, // SMUX Provider
+ SSL_PROV = 6, // SSL Provider
+ TCP_PROV = 7, // TCP Provider
+ VIA_PROV = 8, // Virtual Interface Architecture Provider
+ CTAIP_PROV = 9,
+ MAX_PROVS = 10, // Number of providers
+ INVALID_PROV = 11 // SQL Network Interfaces
}
///
@@ -193,6 +196,59 @@ internal static bool ValidateSslServerCertificate(string targetServerName, X509C
return true;
}
}
+
+ ///
+ /// We validate the provided certificate provided by the client with the one from the server to see if it matches.
+ /// Certificate validation and chain trust validations are done by SSLStream class [System.Net.Security.SecureChannel.VerifyRemoteCertificate method]
+ /// This method is called as a result of callback for SSL Stream Certificate validation.
+ ///
+ /// X.509 certificate provided by the client
+ /// X.509 certificate provided by the server
+ /// Policy errors
+ /// True if certificate is valid
+ internal static bool ValidateSslServerCertificate(X509Certificate clientCert, X509Certificate serverCert, SslPolicyErrors policyErrors)
+ {
+ using (TrySNIEventScope.Create("SNICommon.ValidateSslServerCertificate | SNI | SCOPE | INFO | Entering Scope {0} "))
+ {
+ if (policyErrors == SslPolicyErrors.None)
+ {
+ SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNICommon), EventType.INFO, "serverCert {0}, SSL Server certificate not validated as PolicyErrors set to None.", args0: clientCert.Subject);
+ return true;
+ }
+
+ if ((policyErrors & SslPolicyErrors.RemoteCertificateNameMismatch) != 0)
+ {
+ // Verify that subject name matches
+ if (serverCert.Subject != clientCert.Subject)
+ {
+ SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNICommon), EventType.ERR, "certificate subject from server is {0}, and does not match with the certificate provided client.", args0: serverCert.Subject);
+ return false;
+ }
+ if (!serverCert.Equals(clientCert))
+ {
+ SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNICommon), EventType.ERR, "certificate from server does not match with the certificate provided client.", args0: serverCert.Subject);
+ return false;
+ }
+ }
+ else
+ {
+ // Fail all other SslPolicy cases besides RemoteCertificateNameMismatch
+ SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNICommon), EventType.ERR, "certificate subject: {0}, SslPolicyError {1}, SSL Policy invalidated certificate.", args0: clientCert.Subject, args1: policyErrors);
+ return false;
+ }
+ SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNICommon), EventType.INFO, "certificate subject {0}, Client certificate validated successfully.", args0: clientCert.Subject);
+ return true;
+ }
+ }
+
+ internal static IPAddress[] GetDnsIpAddresses(string serverName)
+ {
+ using (TrySNIEventScope.Create(nameof(GetDnsIpAddresses)))
+ {
+ SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNICommon), EventType.INFO, "Getting DNS host entries for serverName {0}.", args0: serverName);
+ return Dns.GetHostAddresses(serverName);
+ }
+ }
///
/// Sets last error encountered for SNI
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIHandle.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIHandle.cs
index 7613817a23..354ce3eff5 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIHandle.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIHandle.cs
@@ -17,15 +17,7 @@ namespace Microsoft.Data.SqlClient.SNI
///
internal abstract class SNIHandle
{
- ///
- /// Exclude TLS 1.3 in TLS-over-TDS modes (TDS 7.4 and below)
- ///
- protected static readonly SslProtocols s_supportedProtocols = LocalAppContextSwitches.UseSystemDefaultSecureProtocols ? SslProtocols.None : SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls
- //protected readonly SslProtocols SupportedProtocols = SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls
-#pragma warning disable CS0618 // Type or member is obsolete
- | SslProtocols.Ssl2 | SslProtocols.Ssl3
-#pragma warning restore CS0618 // Type or member is obsolete
- ;
+ protected static readonly SslProtocols s_supportedProtocols = SslProtocols.None;
#if !NETSTANDARD2_0
protected static readonly List s_tdsProtocols = new List(1) { new(TdsEnums.TDS8_Protocol) };
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs
index d94874f908..834050b4bb 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs
@@ -142,8 +142,9 @@ private static bool IsErrorStatus(SecurityStatusPalErrorCode errorCode)
/// IP address preference
/// Used for DNS Cache
/// Used for DNS Cache
- ///
- ///
+ /// Support TDS8.0
+ /// Used for the HostName in certificate
+ /// Used for the path to the Server Certificate
/// SNI handle
internal static SNIHandle CreateConnectionHandle(
string fullServerName,
@@ -160,7 +161,8 @@ internal static SNIHandle CreateConnectionHandle(
string cachedFQDN,
ref SQLDNSInfo pendingDNSInfo,
bool tlsFirst,
- string hostNameInCertificate)
+ string hostNameInCertificate,
+ string serverCertificateFilename)
{
instanceName = new byte[1];
@@ -187,8 +189,8 @@ internal static SNIHandle CreateConnectionHandle(
case DataSource.Protocol.None: // default to using tcp if no protocol is provided
case DataSource.Protocol.TCP:
sniHandle = CreateTcpHandle(details, timerExpire, parallel, ipPreference, cachedFQDN, ref pendingDNSInfo,
- tlsFirst, hostNameInCertificate);
- break;
+ tlsFirst, hostNameInCertificate, serverCertificateFilename);
+ break;
case DataSource.Protocol.NP:
sniHandle = CreateNpHandle(details, timerExpire, parallel, tlsFirst);
break;
@@ -284,8 +286,9 @@ private static byte[][] GetSqlServerSPNs(string hostNameOrAddress, string portOr
/// IP address preference
/// Key for DNS Cache
/// Used for DNS Cache
- ///
- ///
+ /// Support TDS8.0
+ /// Host name in certificate
+ /// Used for the path to the Server Certificate
/// SNITCPHandle
private static SNITCPHandle CreateTcpHandle(
DataSource details,
@@ -295,7 +298,8 @@ private static SNITCPHandle CreateTcpHandle(
string cachedFQDN,
ref SQLDNSInfo pendingDNSInfo,
bool tlsFirst,
- string hostNameInCertificate)
+ string hostNameInCertificate,
+ string serverCertificateFilename)
{
// TCP Format:
// tcp:\
@@ -334,7 +338,7 @@ private static SNITCPHandle CreateTcpHandle(
}
return new SNITCPHandle(hostName, port, timerExpire, parallel, ipPreference, cachedFQDN, ref pendingDNSInfo,
- tlsFirst, hostNameInCertificate);
+ tlsFirst, hostNameInCertificate, serverCertificateFilename);
}
///
@@ -388,7 +392,7 @@ private static string GetLocalDBDataSource(string fullServerName, out bool error
Debug.Assert(!string.IsNullOrWhiteSpace(localDBInstance), "Local DB Instance name cannot be empty.");
localDBConnectionString = LocalDB.GetLocalDBConnectionString(localDBInstance);
- if (fullServerName == null)
+ if (fullServerName == null || string.IsNullOrEmpty(localDBConnectionString))
{
// The Last error is set in LocalDB.GetLocalDBConnectionString. We don't need to set Last here.
error = true;
@@ -518,7 +522,18 @@ internal static string GetLocalDBInstance(string dataSource, out bool error)
ReadOnlySpan input = dataSource.AsSpan().TrimStart();
error = false;
// NetStandard 2.0 does not support passing a string to ReadOnlySpan
- if (input.StartsWith(LocalDbHost.AsSpan().Trim(), StringComparison.InvariantCultureIgnoreCase))
+ int index = input.IndexOf(LocalDbHost.AsSpan().Trim(), StringComparison.InvariantCultureIgnoreCase);
+ if (input.StartsWith(LocalDbHost_NP.AsSpan().Trim(), StringComparison.InvariantCultureIgnoreCase))
+ {
+ instanceName = input.Trim().ToString();
+ }
+ else if (index > 0)
+ {
+ SNILoadHandle.SingletonInstance.LastError = new SNIError(SNIProviders.INVALID_PROV, 0, SNICommon.ErrorLocatingServerInstance, Strings.SNI_ERROR_26);
+ SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNIProxy), EventType.ERR, "Incompatible use of prefix with LocalDb: '{0}'", dataSource);
+ error = true;
+ }
+ else if (index == 0)
{
// When netcoreapp support for netcoreapp2.1 is dropped these slice calls could be converted to System.Range\System.Index
// Such ad input = input[1..];
@@ -537,10 +552,6 @@ internal static string GetLocalDBInstance(string dataSource, out bool error)
error = true;
}
}
- else if (input.StartsWith(LocalDbHost_NP.AsSpan().Trim(), StringComparison.InvariantCultureIgnoreCase))
- {
- instanceName = input.Trim().ToString();
- }
return instanceName;
}
@@ -575,10 +586,12 @@ internal static DataSource ParseServerName(string dataSource)
private void InferLocalServerName()
{
// If Server name is empty or localhost, then use "localhost"
- if (string.IsNullOrEmpty(ServerName) || IsLocalHost(ServerName))
+ if (string.IsNullOrEmpty(ServerName) || IsLocalHost(ServerName) ||
+ (Environment.MachineName.Equals(ServerName, StringComparison.CurrentCultureIgnoreCase) &&
+ _connectionProtocol == Protocol.Admin))
{
- ServerName = _connectionProtocol == Protocol.Admin ?
- Environment.MachineName : DefaultHostName;
+ // For DAC use "localhost" instead of the server name.
+ ServerName = DefaultHostName;
}
}
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs
index df34f6c31b..103af2ed2d 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs
@@ -27,6 +27,7 @@ internal sealed class SNITCPHandle : SNIPhysicalHandle
private readonly Socket _socket;
private NetworkStream _tcpStream;
private readonly string _hostNameInCertificate;
+ private readonly string _serverCertificateFilename;
private readonly bool _tlsFirst;
private Stream _stream;
@@ -121,7 +122,8 @@ public override int ProtocolVersion
/// Key for DNS Cache
/// Used for DNS Cache
/// Support TDS8.0
- /// Host Name in Certoficate
+ /// Host Name in Certificate
+ /// Used for the path to the Server Certificate
public SNITCPHandle(
string serverName,
int port,
@@ -131,7 +133,8 @@ public SNITCPHandle(
string cachedFQDN,
ref SQLDNSInfo pendingDNSInfo,
bool tlsFirst,
- string hostNameInCertificate)
+ string hostNameInCertificate,
+ string serverCertificateFilename)
{
using (TrySNIEventScope.Create(nameof(SNITCPHandle)))
{
@@ -140,6 +143,7 @@ public SNITCPHandle(
_targetServer = serverName;
_tlsFirst = tlsFirst;
_hostNameInCertificate = hostNameInCertificate;
+ _serverCertificateFilename = serverCertificateFilename;
_sendSync = new object();
SQLDNSInfo cachedDNSInfo;
@@ -299,14 +303,7 @@ private Socket TryConnectParallel(string hostName, int port, TimeSpan ts, bool i
Socket availableSocket = null;
Task connectTask;
- Task serverAddrTask = Dns.GetHostAddressesAsync(hostName);
- bool complete = serverAddrTask.Wait(ts);
-
- // DNS timed out - don't block
- if (!complete)
- return null;
-
- IPAddress[] serverAddresses = serverAddrTask.Result;
+ IPAddress[] serverAddresses = SNICommon.GetDnsIpAddresses(hostName);
if (serverAddresses.Length > MaxParallelIpAddresses)
{
@@ -358,14 +355,7 @@ private static Socket Connect(string serverName, int port, TimeSpan timeout, boo
{
SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNITCPHandle), EventType.INFO, "IP preference : {0}", Enum.GetName(typeof(SqlConnectionIPAddressPreference), ipPreference));
- Task serverAddrTask = Dns.GetHostAddressesAsync(serverName);
- bool complete = serverAddrTask.Wait(timeout);
-
- // DNS timed out - don't block
- if (!complete)
- return null;
-
- IPAddress[] ipAddresses = serverAddrTask.Result;
+ IPAddress[] ipAddresses = SNICommon.GetDnsIpAddresses(serverName);
string IPv4String = null;
string IPv6String = null;
@@ -663,17 +653,18 @@ public override void DisableSsl()
/// Validate server certificate callback
///
/// Sender object
- /// X.509 certificate
+ /// X.509 certificate provided from the server
/// X.509 chain
/// Policy errors
/// True if certificate is valid
- private bool ValidateServerCertificate(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors policyErrors)
+ private bool ValidateServerCertificate(object sender, X509Certificate serverCertificate, X509Chain chain, SslPolicyErrors policyErrors)
{
if (!_validateCert)
{
SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNITCPHandle), EventType.INFO, "Connection Id {0}, Certificate will not be validated.", args0: _connectionId);
return true;
}
+
string serverNameToValidate;
if (!string.IsNullOrEmpty(_hostNameInCertificate))
{
@@ -684,8 +675,23 @@ private bool ValidateServerCertificate(object sender, X509Certificate cert, X509
serverNameToValidate = _targetServer;
}
+ if (!string.IsNullOrEmpty(_serverCertificateFilename))
+ {
+ X509Certificate clientCertificate = null;
+ try
+ {
+ clientCertificate = new X509Certificate(_serverCertificateFilename);
+ return SNICommon.ValidateSslServerCertificate(clientCertificate, serverCertificate, policyErrors);
+ }
+ catch (Exception e)
+ {
+ // if this fails, then fall back to the HostNameInCertificate or TargetServer validation.
+ SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNITCPHandle), EventType.INFO, "Connection Id {0}, IOException occurred: {1}", args0: _connectionId, args1: e.Message);
+ }
+ }
+
SqlClientEventSource.Log.TrySNITraceEvent(nameof(SNITCPHandle), EventType.INFO, "Connection Id {0}, Certificate will be validated for Target Server name", args0: _connectionId);
- return SNICommon.ValidateSslServerCertificate(serverNameToValidate, cert, policyErrors);
+ return SNICommon.ValidateSslServerCertificate(serverNameToValidate, serverCertificate, policyErrors);
}
///
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SSRP.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SSRP.cs
index 655a54df7e..e51175059a 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SSRP.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SSRP.cs
@@ -170,7 +170,16 @@ private static byte[] SendUDPRequest(string browserHostname, int port, byte[] re
Debug.Assert(port >= 0 && port <= 65535, "Invalid port");
Debug.Assert(requestPacket != null && requestPacket.Length > 0, "requestPacket should not be null or 0-length array");
- bool isIpAddress = IPAddress.TryParse(browserHostname, out IPAddress address);
+ if (IPAddress.TryParse(browserHostname, out IPAddress address))
+ {
+ SsrpResult response = SendUDPRequest(new IPAddress[] { address }, port, requestPacket, allIPsInParallel);
+ if (response != null && response.ResponsePacket != null)
+ return response.ResponsePacket;
+ else if (response != null && response.Error != null)
+ throw response.Error;
+ else
+ return null;
+ }
TimeSpan ts = default;
// In case the Timeout is Infinite, we will receive the max value of Int64 as the tick count
@@ -181,27 +190,7 @@ private static byte[] SendUDPRequest(string browserHostname, int port, byte[] re
ts = ts.Ticks < 0 ? TimeSpan.FromTicks(0) : ts;
}
- IPAddress[] ipAddresses = null;
- if (!isIpAddress)
- {
- Task serverAddrTask = Dns.GetHostAddressesAsync(browserHostname);
- bool taskComplete;
- try
- {
- taskComplete = serverAddrTask.Wait(ts);
- }
- catch (AggregateException ae)
- {
- throw ae.InnerException;
- }
-
- // If DNS took too long, need to return instead of blocking
- if (!taskComplete)
- return null;
-
- ipAddresses = serverAddrTask.Result;
- }
-
+ IPAddress[] ipAddresses = SNICommon.GetDnsIpAddresses(browserHostname);
Debug.Assert(ipAddresses.Length > 0, "DNS should throw if zero addresses resolve");
switch (ipPreference)
@@ -278,7 +267,7 @@ private static SsrpResult SendUDPRequest(IPAddress[] ipAddresses, int port, byte
for (int i = 0; i < ipAddresses.Length; i++)
{
IPEndPoint endPoint = new IPEndPoint(ipAddresses[i], port);
- tasks.Add(Task.Factory.StartNew(() => SendUDPRequest(endPoint, requestPacket)));
+ tasks.Add(Task.Factory.StartNew(() => SendUDPRequest(endPoint, requestPacket), cts.Token));
}
List> completedTasks = new();
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs
index c6f2786583..d644acbea7 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs
@@ -79,7 +79,15 @@ public override byte[] DecryptColumnEncryptionKey(string masterKeyPath, string e
// Parse the path and get the X509 cert
X509Certificate2 certificate = GetCertificateByPath(masterKeyPath, isSystemOp: true);
- int keySizeInBytes = certificate.PublicKey.Key.KeySize / 8;
+
+ RSA RSAPublicKey = certificate.GetRSAPublicKey();
+ int keySizeInBytes;
+#if NETCOREAPP || NETSTANDARD2_1
+ DSA DSAPublicKey = certificate.GetDSAPublicKey();
+ keySizeInBytes = RSAPublicKey is not null ? RSAPublicKey.KeySize / 8 : DSAPublicKey.KeySize / 8;
+#else
+ keySizeInBytes= RSAPublicKey.KeySize / 8;
+#endif
// Validate and decrypt the EncryptedColumnEncryptionKey
// Format is
@@ -172,7 +180,15 @@ public override byte[] EncryptColumnEncryptionKey(string masterKeyPath, string e
// Parse the certificate path and get the X509 cert
X509Certificate2 certificate = GetCertificateByPath(masterKeyPath, isSystemOp: false);
- int keySizeInBytes = certificate.PublicKey.Key.KeySize / 8;
+
+ RSA RSAPublicKey = certificate.GetRSAPublicKey();
+ int keySizeInBytes;
+#if NETCOREAPP || NETSTANDARD2_1
+ DSA DSAPublicKey = certificate.GetDSAPublicKey();
+ keySizeInBytes = RSAPublicKey is not null ? RSAPublicKey.KeySize / 8 : DSAPublicKey.KeySize / 8;
+#else
+ keySizeInBytes= RSAPublicKey.KeySize / 8;
+#endif
// Construct the encryptedColumnEncryptionKey
// Format is
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionEnclaveProvider.NetCoreApp.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionEnclaveProvider.NetCoreApp.cs
index cca04fc323..fd81db557d 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionEnclaveProvider.NetCoreApp.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionEnclaveProvider.NetCoreApp.cs
@@ -15,8 +15,8 @@ internal abstract partial class SqlColumnEncryptionEnclaveProvider
/// The information the provider uses to attest the enclave and generate a symmetric key for the session. The format of this information is specific to the enclave attestation protocol.
/// A Diffie-Hellman algorithm object encapsulating a client-side key pair.
/// The set of parameters required for enclave session.
- /// The set of extra data needed for attestating the enclave.
- /// The length of the extra data needed for attestating the enclave.
+ /// The set of extra data needed for attesting the enclave.
+ /// The length of the extra data needed for attesting the enclave.
/// The requested enclave session or null if the provider does not implement session caching.
/// A counter that the enclave provider is expected to increment each time SqlClient retrieves the session from the cache. The purpose of this field is to prevent replay attacks.
internal abstract void CreateEnclaveSession(byte[] enclaveAttestationInfo, ECDiffieHellman clientDiffieHellmanKey, EnclaveSessionParameters enclaveSessionParameters, byte[] customData, int customDataLength,
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionEnclaveProvider.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionEnclaveProvider.cs
index e374d43665..9223702509 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionEnclaveProvider.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlColumnEncryptionEnclaveProvider.cs
@@ -8,7 +8,7 @@ namespace Microsoft.Data.SqlClient
internal abstract partial class SqlColumnEncryptionEnclaveProvider
{
///
- internal abstract void GetEnclaveSession(EnclaveSessionParameters enclaveSessionParameters, bool generateCustomData, out SqlEnclaveSession sqlEnclaveSession, out long counter, out byte[] customData, out int customDataLength);
+ internal abstract void GetEnclaveSession(EnclaveSessionParameters enclaveSessionParameters, bool generateCustomData, bool isRetry, out SqlEnclaveSession sqlEnclaveSession, out long counter, out byte[] customData, out int customDataLength);
///
internal abstract SqlEnclaveAttestationParameters GetAttestationParameters(string attestationUrl, byte[] customData, int customDataLength);
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs
index 6c8140000e..f3b26e7899 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs
@@ -46,7 +46,7 @@ public sealed partial class SqlCommand : DbCommand, ICloneable
private static readonly Func s_beginExecuteXmlReaderInternal = BeginExecuteXmlReaderInternalCallback;
private static readonly Func s_beginExecuteNonQueryInternal = BeginExecuteNonQueryInternalCallback;
- internal sealed class ExecuteReaderAsyncCallContext : AAsyncCallContext
+ internal sealed class ExecuteReaderAsyncCallContext : AAsyncCallContext
{
public Guid OperationID;
public CommandBehavior CommandBehavior;
@@ -54,7 +54,7 @@ internal sealed class ExecuteReaderAsyncCallContext : AAsyncCallContext _owner;
public TaskCompletionSource TaskCompletionSource => _source;
- public void Set(SqlCommand command, TaskCompletionSource source, IDisposable disposable, CommandBehavior behavior, Guid operationID)
+ public void Set(SqlCommand command, TaskCompletionSource source, CancellationTokenRegistration disposable, CommandBehavior behavior, Guid operationID)
{
base.Set(command, source, disposable);
CommandBehavior = behavior;
@@ -73,6 +73,31 @@ protected override void AfterCleared(SqlCommand owner)
}
}
+ internal sealed class ExecuteNonQueryAsyncCallContext : AAsyncCallContext
+ {
+ public Guid OperationID;
+
+ public SqlCommand Command => _owner;
+
+ public TaskCompletionSource TaskCompletionSource => _source;
+
+ public void Set(SqlCommand command, TaskCompletionSource source, CancellationTokenRegistration disposable, Guid operationID)
+ {
+ base.Set(command, source, disposable);
+ OperationID = operationID;
+ }
+
+ protected override void Clear()
+ {
+ OperationID = default;
+ }
+
+ protected override void AfterCleared(SqlCommand owner)
+ {
+
+ }
+ }
+
private CommandType _commandType;
private int? _commandTimeout;
private UpdateRowSource _updatedRowSource = UpdateRowSource.Both;
@@ -112,6 +137,11 @@ protected override void AfterCleared(SqlCommand owner)
/// Internal flag for testing purposes that forces all queries to internally end async calls.
///
private static bool _forceInternalEndQuery = false;
+
+ ///
+ /// Internal flag for testing purposes that forces one RetryableEnclaveQueryExecutionException during GenerateEnclavePackage
+ ///
+ private static bool _forceRetryableEnclaveQueryExecutionExceptionDuringGenerateEnclavePackage = false;
#endif
private static readonly SqlDiagnosticListener s_diagnosticListener = new SqlDiagnosticListener(SqlClientDiagnosticListenerExtensions.DiagnosticListenerName);
@@ -2196,7 +2226,7 @@ private IAsyncResult BeginExecuteReaderInternal(CommandBehavior behavior, AsyncC
// back into pool when we should not.
}
- bool usedCache;
+ bool usedCache = false;
Task writeTask = null;
try
{
@@ -2213,7 +2243,10 @@ private IAsyncResult BeginExecuteReaderInternal(CommandBehavior behavior, AsyncC
// For async, RunExecuteReader will never put the stateObj back into the pool, so do so now.
ReliablePutStateObject();
- throw;
+ if (inRetry || e is not EnclaveDelegate.RetryableEnclaveQueryExecutionException)
+ {
+ throw;
+ }
}
if (writeTask != null)
@@ -2414,12 +2447,7 @@ long firstAttemptStart
// Remove the entry from the cache since it was inconsistent.
SqlQueryMetadataCache.GetInstance().InvalidateCacheEntry(this);
- if (ShouldUseEnclaveBasedWorkflow && this.enclavePackage != null)
- {
- EnclaveSessionParameters enclaveSessionParameters = new EnclaveSessionParameters(this._activeConnection.DataSource, this._activeConnection.EnclaveAttestationUrl, this._activeConnection.Database);
- EnclaveDelegate.Instance.InvalidateEnclaveSession(this._activeConnection.AttestationProtocol, this._activeConnection.Parser.EnclaveType,
- enclaveSessionParameters, this.enclavePackage.EnclaveSession);
- }
+ InvalidateEnclaveSession();
try
{
@@ -2455,6 +2483,26 @@ long firstAttemptStart
}, TaskScheduler.Default);
}
+ private void InvalidateEnclaveSession()
+ {
+ if (ShouldUseEnclaveBasedWorkflow && this.enclavePackage != null)
+ {
+ EnclaveDelegate.Instance.InvalidateEnclaveSession(
+ this._activeConnection.AttestationProtocol,
+ this._activeConnection.Parser.EnclaveType,
+ GetEnclaveSessionParameters(),
+ this.enclavePackage.EnclaveSession);
+ }
+ }
+
+ private EnclaveSessionParameters GetEnclaveSessionParameters()
+ {
+ return new EnclaveSessionParameters(
+ this._activeConnection.DataSource,
+ this._activeConnection.EnclaveAttestationUrl,
+ this._activeConnection.Database);
+ }
+
private void BeginExecuteReaderInternalReadStage(TaskCompletionSource
/// Resultset from calling to sp_describe_parameter_encryption
/// Readonly dictionary with the map of parameter encryption rpc requests with the corresponding original rpc requests.
- private void ReadDescribeEncryptionParameterResults(SqlDataReader ds, ReadOnlyDictionary<_SqlRPC, _SqlRPC> describeParameterEncryptionRpcOriginalRpcMap)
+ /// Indicates if this is a retry from a failed call.
+ private void ReadDescribeEncryptionParameterResults(SqlDataReader ds, ReadOnlyDictionary<_SqlRPC, _SqlRPC> describeParameterEncryptionRpcOriginalRpcMap, bool isRetry)
{
_SqlRPC rpc = null;
int currentOrdinal = -1;
@@ -4400,9 +4495,16 @@ private void ReadDescribeEncryptionParameterResults(SqlDataReader ds, ReadOnlyDi
SqlConnectionAttestationProtocol attestationProtocol = this._activeConnection.AttestationProtocol;
string enclaveType = this._activeConnection.Parser.EnclaveType;
- EnclaveSessionParameters enclaveSessionParameters = new EnclaveSessionParameters(this._activeConnection.DataSource, this._activeConnection.EnclaveAttestationUrl, this._activeConnection.Database);
- EnclaveDelegate.Instance.CreateEnclaveSession(attestationProtocol, enclaveType, enclaveSessionParameters, attestationInfo, enclaveAttestationParameters, customData, customDataLength);
+ EnclaveDelegate.Instance.CreateEnclaveSession(
+ attestationProtocol,
+ enclaveType,
+ GetEnclaveSessionParameters(),
+ attestationInfo,
+ enclaveAttestationParameters,
+ customData,
+ customDataLength,
+ isRetry);
enclaveAttestationParameters = null;
attestationInfoRead = true;
}
@@ -4503,7 +4605,7 @@ internal SqlDataReader RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior
catch (EnclaveDelegate.RetryableEnclaveQueryExecutionException)
{
- if (inRetry || isAsync)
+ if (inRetry)
{
throw;
}
@@ -4512,22 +4614,16 @@ internal SqlDataReader RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior
// First invalidate the entry from the cache, so that we refresh our encryption MD.
SqlQueryMetadataCache.GetInstance().InvalidateCacheEntry(this);
- if (ShouldUseEnclaveBasedWorkflow && this.enclavePackage != null)
- {
- EnclaveSessionParameters enclaveSessionParameters = new EnclaveSessionParameters(this._activeConnection.DataSource, this._activeConnection.EnclaveAttestationUrl, this._activeConnection.Database);
- EnclaveDelegate.Instance.InvalidateEnclaveSession(this._activeConnection.AttestationProtocol, this._activeConnection.Parser.EnclaveType,
- enclaveSessionParameters, this.enclavePackage.EnclaveSession);
- }
+ InvalidateEnclaveSession();
- return RunExecuteReader(cmdBehavior, runBehavior, returnStream, null, TdsParserStaticMethods.GetRemainingTimeout(timeout, firstAttemptStart), out task, out usedCache, isAsync, inRetry: true, method: method);
+ return RunExecuteReader(cmdBehavior, runBehavior, returnStream, completion, TdsParserStaticMethods.GetRemainingTimeout(timeout, firstAttemptStart), out task, out usedCache, isAsync, inRetry: true, method: method);
}
catch (SqlException ex)
{
// We only want to retry once, so don't retry if we are already in retry.
// If we didn't use the cache, we don't want to retry.
- // The async retried are handled separately, handle only sync calls here.
- if (inRetry || isAsync || (!usedCache && !ShouldUseEnclaveBasedWorkflow))
+ if (inRetry || (!usedCache && !ShouldUseEnclaveBasedWorkflow))
{
throw;
}
@@ -4556,14 +4652,9 @@ internal SqlDataReader RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior
// First invalidate the entry from the cache, so that we refresh our encryption MD.
SqlQueryMetadataCache.GetInstance().InvalidateCacheEntry(this);
- if (ShouldUseEnclaveBasedWorkflow && this.enclavePackage != null)
- {
- EnclaveSessionParameters enclaveSessionParameters = new EnclaveSessionParameters(this._activeConnection.DataSource, this._activeConnection.EnclaveAttestationUrl, this._activeConnection.Database);
- EnclaveDelegate.Instance.InvalidateEnclaveSession(this._activeConnection.AttestationProtocol, this._activeConnection.Parser.EnclaveType,
- enclaveSessionParameters, this.enclavePackage.EnclaveSession);
- }
+ InvalidateEnclaveSession();
- return RunExecuteReader(cmdBehavior, runBehavior, returnStream, null, TdsParserStaticMethods.GetRemainingTimeout(timeout, firstAttemptStart), out task, out usedCache, isAsync, inRetry: true, method: method);
+ return RunExecuteReader(cmdBehavior, runBehavior, returnStream, completion, TdsParserStaticMethods.GetRemainingTimeout(timeout, firstAttemptStart), out task, out usedCache, isAsync, inRetry: true, method: method);
}
}
}
@@ -4663,9 +4754,15 @@ private void GenerateEnclavePackage()
try
{
- EnclaveSessionParameters enclaveSessionParameters = new EnclaveSessionParameters(this._activeConnection.DataSource, this._activeConnection.EnclaveAttestationUrl, this._activeConnection.Database);
+#if DEBUG
+ if (_forceRetryableEnclaveQueryExecutionExceptionDuringGenerateEnclavePackage)
+ {
+ _forceRetryableEnclaveQueryExecutionExceptionDuringGenerateEnclavePackage = false;
+ throw new EnclaveDelegate.RetryableEnclaveQueryExecutionException("testing", null);
+ }
+#endif
this.enclavePackage = EnclaveDelegate.Instance.GenerateEnclavePackage(attestationProtocol, keysToBeSentToEnclave,
- this.CommandText, enclaveType, enclaveSessionParameters, _activeConnection, this);
+ this.CommandText, enclaveType, GetEnclaveSessionParameters(), _activeConnection, this);
}
catch (EnclaveDelegate.RetryableEnclaveQueryExecutionException)
{
@@ -4723,8 +4820,7 @@ private SqlDataReader RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavi
bool processFinallyBlock = true;
bool decrementAsyncCountOnFailure = false;
- // If we are in retry, don't increment the Async count. This should have already been set.
- if (isAsync && !inRetry)
+ if (isAsync)
{
_activeConnection.GetOpenTdsConnection().IncrementAsyncCount();
decrementAsyncCountOnFailure = true;
@@ -5746,6 +5842,7 @@ private _SqlRPC BuildPrepExec(CommandBehavior behavior)
sqlParam.SqlDbType = ((paramList.Length << 1) <= TdsEnums.TYPE_SIZE_LIMIT) ? SqlDbType.NVarChar : SqlDbType.NText;
sqlParam.Value = paramList;
sqlParam.Size = paramList.Length;
+ sqlParam.Direction = ParameterDirection.Input;
//@batch_text
string text = GetCommandText(behavior);
@@ -5753,6 +5850,7 @@ private _SqlRPC BuildPrepExec(CommandBehavior behavior)
sqlParam.SqlDbType = ((text.Length << 1) <= TdsEnums.TYPE_SIZE_LIMIT) ? SqlDbType.NVarChar : SqlDbType.NText;
sqlParam.Size = text.Length;
sqlParam.Value = text;
+ sqlParam.Direction = ParameterDirection.Input;
SetUpRPCParameters(rpc, false, _parameters);
return rpc;
@@ -5854,6 +5952,7 @@ private _SqlRPC BuildExecute(bool inSchema)
//@handle
SqlParameter sqlParam = rpc.systemParams[0];
sqlParam.SqlDbType = SqlDbType.Int;
+ sqlParam.Size = 4;
sqlParam.Value = _prepareHandle;
sqlParam.Direction = ParameterDirection.Input;
@@ -5906,6 +6005,7 @@ private void BuildExecuteSql(CommandBehavior behavior, string commandText, SqlPa
sqlParam.SqlDbType = ((paramList.Length << 1) <= TdsEnums.TYPE_SIZE_LIMIT) ? SqlDbType.NVarChar : SqlDbType.NText;
sqlParam.Size = paramList.Length;
sqlParam.Value = paramList;
+ sqlParam.Direction = ParameterDirection.Input;
bool inSchema = (0 != (behavior & CommandBehavior.SchemaOnly));
SetUpRPCParameters(rpc, inSchema, parameters);
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs
index 660b5934e0..1040061b59 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs
@@ -1820,7 +1820,7 @@ private bool TryOpen(TaskCompletionSource retry, SqlConnec
}
}
- _applyTransientFaultHandling = (!overrides.HasFlag(SqlConnectionOverrides.OpenWithoutRetry) && retry == null && connectionOptions != null && connectionOptions.ConnectRetryCount > 0);
+ _applyTransientFaultHandling = (!overrides.HasFlag(SqlConnectionOverrides.OpenWithoutRetry) && connectionOptions != null && connectionOptions.ConnectRetryCount > 0);
if (connectionOptions != null &&
(connectionOptions.Authentication == SqlAuthenticationMethod.SqlPassword ||
@@ -1849,7 +1849,7 @@ private bool TryOpen(TaskCompletionSource retry, SqlConnec
// does not require GC.KeepAlive(this) because of ReRegisterForFinalize below.
// Set future transient fault handling based on connection options
- _applyTransientFaultHandling = (retry == null && connectionOptions != null && connectionOptions.ConnectRetryCount > 0);
+ _applyTransientFaultHandling = connectionOptions != null && connectionOptions.ConnectRetryCount > 0;
var tdsInnerConnection = (SqlInternalConnectionTds)InnerConnection;
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDataReader.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDataReader.cs
index a801697d8f..965803f993 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDataReader.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDataReader.cs
@@ -2843,6 +2843,16 @@ private T GetFieldValueFromSqlBufferInternal(SqlBuffer data, _SqlMetaData met
{
return (T)(object)data.DateTime;
}
+#if NET6_0_OR_GREATER
+ else if (typeof(T) == typeof(DateOnly) && dataType == typeof(DateTime) && _typeSystem > SqlConnectionString.TypeSystem.SQLServer2005 && metaData.Is2008DateTimeType)
+ {
+ return (T)(object)data.DateOnly;
+ }
+ else if (typeof(T) == typeof(TimeOnly) && dataType == typeof(TimeOnly) && _typeSystem > SqlConnectionString.TypeSystem.SQLServer2005 && metaData.Is2008DateTimeType)
+ {
+ return (T)(object)data.TimeOnly;
+ }
+#endif
else if (typeof(T) == typeof(XmlReader))
{
// XmlReader only allowed on XML types
@@ -3472,7 +3482,9 @@ private bool TryReadInternal(bool setTimeout, out bool more)
SqlStatistics statistics = null;
using (TryEventScope.Create("SqlDataReader.TryReadInternal | API | Object Id {0}", ObjectID))
{
+#if !NET6_0_OR_GREATER
RuntimeHelpers.PrepareConstrainedRegions();
+#endif
try
{
@@ -4397,6 +4409,7 @@ private void AssertReaderState(bool requireData, bool permitAsync, int? columnIn
public override Task NextResultAsync(CancellationToken cancellationToken)
{
using (TryEventScope.Create("SqlDataReader.NextResultAsync | API | Object Id {0}", ObjectID))
+ using (var registrationHolder = new DisposableTemporaryOnStack())
{
TaskCompletionSource source = new TaskCompletionSource();
@@ -4406,7 +4419,6 @@ public override Task NextResultAsync(CancellationToken cancellationToken)
return source.Task;
}
- IDisposable registration = null;
if (cancellationToken.CanBeCanceled)
{
if (cancellationToken.IsCancellationRequested)
@@ -4414,7 +4426,7 @@ public override Task NextResultAsync(CancellationToken cancellationToken)
source.SetCanceled();
return source.Task;
}
- registration = cancellationToken.Register(SqlCommand.s_cancelIgnoreFailure, _command);
+ registrationHolder.Set(cancellationToken.Register(SqlCommand.s_cancelIgnoreFailure, _command));
}
Task original = Interlocked.CompareExchange(ref _currentTask, source.Task, null);
@@ -4432,7 +4444,7 @@ public override Task NextResultAsync(CancellationToken cancellationToken)
return source.Task;
}
- return InvokeAsyncCall(new HasNextResultAsyncCallContext(this, source, registration));
+ return InvokeAsyncCall(new HasNextResultAsyncCallContext(this, source, registrationHolder.Take()));
}
}
@@ -4706,7 +4718,7 @@ out bytesRead
Debug.Assert(context.Source != null, "context._source should not be null when continuing");
// setup for cleanup/completing
retryTask.ContinueWith(
- continuationAction: SqlDataReaderAsyncCallContext.s_completeCallback,
+ continuationAction: SqlDataReaderBaseAsyncCallContext.s_completeCallback,
state: context,
TaskScheduler.Default
);
@@ -4727,12 +4739,19 @@ out bytesRead
public override Task ReadAsync(CancellationToken cancellationToken)
{
using (TryEventScope.Create("SqlDataReader.ReadAsync | API | Object Id {0}", ObjectID))
+ using (var registrationHolder = new DisposableTemporaryOnStack())
{
if (IsClosed)
{
return Task.FromException(ADP.ExceptionWithStackTrace(ADP.DataReaderClosed()));
}
+ // Register first to catch any already expired tokens to be able to trigger cancellation event.
+ if (cancellationToken.CanBeCanceled)
+ {
+ registrationHolder.Set(cancellationToken.Register(SqlCommand.s_cancelIgnoreFailure, _command));
+ }
+
// If user's token is canceled, return a canceled task
if (cancellationToken.IsCancellationRequested)
{
@@ -4831,12 +4850,6 @@ public override Task ReadAsync(CancellationToken cancellationToken)
return source.Task;
}
- IDisposable registration = null;
- if (cancellationToken.CanBeCanceled)
- {
- registration = cancellationToken.Register(SqlCommand.s_cancelIgnoreFailure, _command);
- }
-
ReadAsyncCallContext context = null;
if (_connection?.InnerConnection is SqlInternalConnection sqlInternalConnection)
{
@@ -4847,9 +4860,9 @@ public override Task ReadAsync(CancellationToken cancellationToken)
context = new ReadAsyncCallContext();
}
- Debug.Assert(context.Reader == null && context.Source == null && context.Disposable == null, "cached ReadAsyncCallContext was not properly disposed");
+ Debug.Assert(context.Reader == null && context.Source == null && context.Disposable == default, "cached ReadAsyncCallContext was not properly disposed");
- context.Set(this, source, registration);
+ context.Set(this, source, registrationHolder.Take());
context._hasMoreData = more;
context._hasReadRowToken = rowTokenRead;
@@ -4987,49 +5000,51 @@ override public Task IsDBNullAsync(int i, CancellationToken cancellationTo
return Task.FromException(ex);
}
- // Setup and check for pending task
- TaskCompletionSource source = new TaskCompletionSource();
- Task original = Interlocked.CompareExchange(ref _currentTask, source.Task, null);
- if (original != null)
+ using (var registrationHolder = new DisposableTemporaryOnStack())
{
- source.SetException(ADP.ExceptionWithStackTrace(ADP.AsyncOperationPending()));
- return source.Task;
- }
+ // Setup and check for pending task
+ TaskCompletionSource source = new TaskCompletionSource();
+ Task original = Interlocked.CompareExchange(ref _currentTask, source.Task, null);
+ if (original != null)
+ {
+ source.SetException(ADP.ExceptionWithStackTrace(ADP.AsyncOperationPending()));
+ return source.Task;
+ }
- // Check if cancellation due to close is requested (this needs to be done after setting _currentTask)
- if (_cancelAsyncOnCloseToken.IsCancellationRequested)
- {
- source.SetCanceled();
- _currentTask = null;
- return source.Task;
- }
+ // Check if cancellation due to close is requested (this needs to be done after setting _currentTask)
+ if (_cancelAsyncOnCloseToken.IsCancellationRequested)
+ {
+ source.SetCanceled();
+ _currentTask = null;
+ return source.Task;
+ }
- // Setup cancellations
- IDisposable registration = null;
- if (cancellationToken.CanBeCanceled)
- {
- registration = cancellationToken.Register(SqlCommand.s_cancelIgnoreFailure, _command);
- }
+ // Setup cancellations
+ if (cancellationToken.CanBeCanceled)
+ {
+ registrationHolder.Set(cancellationToken.Register(SqlCommand.s_cancelIgnoreFailure, _command));
+ }
- IsDBNullAsyncCallContext context = null;
- if (_connection?.InnerConnection is SqlInternalConnection sqlInternalConnection)
- {
- context = Interlocked.Exchange(ref sqlInternalConnection.CachedDataReaderIsDBNullContext, null);
- }
- if (context is null)
- {
- context = new IsDBNullAsyncCallContext();
- }
+ IsDBNullAsyncCallContext context = null;
+ if (_connection?.InnerConnection is SqlInternalConnection sqlInternalConnection)
+ {
+ context = Interlocked.Exchange(ref sqlInternalConnection.CachedDataReaderIsDBNullContext, null);
+ }
+ if (context is null)
+ {
+ context = new IsDBNullAsyncCallContext();
+ }
- Debug.Assert(context.Reader == null && context.Source == null && context.Disposable == null, "cached ISDBNullAsync context not properly disposed");
+ Debug.Assert(context.Reader == null && context.Source == null && context.Disposable == default, "cached ISDBNullAsync context not properly disposed");
- context.Set(this, source, registration);
- context._columnIndex = i;
+ context.Set(this, source, registrationHolder.Take());
+ context._columnIndex = i;
- // Setup async
- PrepareAsyncInvocation(useSnapshot: true);
+ // Setup async
+ PrepareAsyncInvocation(useSnapshot: true);
- return InvokeAsyncCall(context);
+ return InvokeAsyncCall(context);
+ }
}
}
@@ -5134,37 +5149,39 @@ override public Task GetFieldValueAsync(int i, CancellationToken cancellat
return Task.FromException(ex);
}
- // Setup and check for pending task
- TaskCompletionSource source = new TaskCompletionSource();
- Task original = Interlocked.CompareExchange(ref _currentTask, source.Task, null);
- if (original != null)
+ using (var registrationHolder = new DisposableTemporaryOnStack())
{
- source.SetException(ADP.ExceptionWithStackTrace(ADP.AsyncOperationPending()));
- return source.Task;
- }
+ // Setup and check for pending task
+ TaskCompletionSource source = new TaskCompletionSource();
+ Task original = Interlocked.CompareExchange(ref _currentTask, source.Task, null);
+ if (original != null)
+ {
+ source.SetException(ADP.ExceptionWithStackTrace(ADP.AsyncOperationPending()));
+ return source.Task;
+ }
- // Check if cancellation due to close is requested (this needs to be done after setting _currentTask)
- if (_cancelAsyncOnCloseToken.IsCancellationRequested)
- {
- source.SetCanceled();
- _currentTask = null;
- return source.Task;
- }
+ // Check if cancellation due to close is requested (this needs to be done after setting _currentTask)
+ if (_cancelAsyncOnCloseToken.IsCancellationRequested)
+ {
+ source.SetCanceled();
+ _currentTask = null;
+ return source.Task;
+ }
- // Setup cancellations
- IDisposable registration = null;
- if (cancellationToken.CanBeCanceled)
- {
- registration = cancellationToken.Register(SqlCommand.s_cancelIgnoreFailure, _command);
- }
+ // Setup cancellations
+ if (cancellationToken.CanBeCanceled)
+ {
+ registrationHolder.Set(cancellationToken.Register(SqlCommand.s_cancelIgnoreFailure, _command));
+ }
- // Setup async
- PrepareAsyncInvocation(useSnapshot: true);
+ // Setup async
+ PrepareAsyncInvocation(useSnapshot: true);
- GetFieldValueAsyncCallContext context = new GetFieldValueAsyncCallContext(this, source, registration);
- context._columnIndex = i;
+ GetFieldValueAsyncCallContext context = new GetFieldValueAsyncCallContext(this, source, registrationHolder.Take());
+ context._columnIndex = i;
- return InvokeAsyncCall(context);
+ return InvokeAsyncCall(context);
+ }
}
private static Task GetFieldValueAsyncExecute(Task task, object state)
@@ -5216,49 +5233,63 @@ internal void CompletePendingReadWithFailure(int errorCode, bool resetForcePendi
}
#endif
-
- internal abstract class SqlDataReaderAsyncCallContext : AAsyncCallContext
+
+ internal abstract class SqlDataReaderBaseAsyncCallContext : AAsyncBaseCallContext
{
internal static readonly Action, object> s_completeCallback = CompleteAsyncCallCallback;
internal static readonly Func> s_executeCallback = ExecuteAsyncCallCallback;
- protected SqlDataReaderAsyncCallContext()
+ protected SqlDataReaderBaseAsyncCallContext()
{
}
- protected SqlDataReaderAsyncCallContext(SqlDataReader owner, TaskCompletionSource source, IDisposable disposable = null)
+ protected SqlDataReaderBaseAsyncCallContext(SqlDataReader owner, TaskCompletionSource source)
{
- Set(owner, source, disposable);
+ Set(owner, source);
}
internal abstract Func> Execute { get; }
internal SqlDataReader Reader { get => _owner; set => _owner = value; }
- public IDisposable Disposable { get => _disposable; set => _disposable = value; }
-
public TaskCompletionSource Source { get => _source; set => _source = value; }
- new public void Set(SqlDataReader reader, TaskCompletionSource source, IDisposable disposable)
- {
- base.Set(reader, source, disposable);
- }
-
private static Task ExecuteAsyncCallCallback(Task task, object state)
{
- SqlDataReaderAsyncCallContext context = (SqlDataReaderAsyncCallContext)state;
+ SqlDataReaderBaseAsyncCallContext context = (SqlDataReaderBaseAsyncCallContext)state;
return context.Reader.ContinueAsyncCall(task, context);
}
private static void CompleteAsyncCallCallback(Task task, object state)
{
- SqlDataReaderAsyncCallContext context = (SqlDataReaderAsyncCallContext)state;
+ SqlDataReaderBaseAsyncCallContext context = (SqlDataReaderBaseAsyncCallContext)state;
context.Reader.CompleteAsyncCall(task, context);
}
}
- internal sealed class ReadAsyncCallContext : SqlDataReaderAsyncCallContext
+ internal abstract class SqlDataReaderAsyncCallContext : SqlDataReaderBaseAsyncCallContext
+ where TDisposable : IDisposable
+ {
+ private TDisposable _disposable;
+
+ public TDisposable Disposable { get => _disposable; set => _disposable = value; }
+
+ public void Set(SqlDataReader owner, TaskCompletionSource source, TDisposable disposable)
+ {
+ base.Set(owner, source);
+ _disposable = disposable;
+ }
+
+ protected override void DisposeCore()
+ {
+ TDisposable copy = _disposable;
+ _disposable = default;
+ copy?.Dispose();
+ }
+ }
+
+ internal sealed class ReadAsyncCallContext : SqlDataReaderAsyncCallContext
{
internal static readonly Func> s_execute = SqlDataReader.ReadAsyncExecute;
@@ -5277,7 +5308,7 @@ protected override void AfterCleared(SqlDataReader owner)
}
}
- internal sealed class IsDBNullAsyncCallContext : SqlDataReaderAsyncCallContext
+ internal sealed class IsDBNullAsyncCallContext : SqlDataReaderAsyncCallContext
{
internal static readonly Func> s_execute = SqlDataReader.IsDBNullAsyncExecute;
@@ -5293,19 +5324,19 @@ protected override void AfterCleared(SqlDataReader owner)
}
}
- private sealed class HasNextResultAsyncCallContext : SqlDataReaderAsyncCallContext
+ private sealed class HasNextResultAsyncCallContext : SqlDataReaderAsyncCallContext
{
private static readonly Func> s_execute = SqlDataReader.NextResultAsyncExecute;
- public HasNextResultAsyncCallContext(SqlDataReader reader, TaskCompletionSource source, IDisposable disposable)
- : base(reader, source, disposable)
+ public HasNextResultAsyncCallContext(SqlDataReader reader, TaskCompletionSource source, CancellationTokenRegistration disposable)
{
+ Set(reader, source, disposable);
}
internal override Func> Execute => s_execute;
}
- private sealed class GetBytesAsyncCallContext : SqlDataReaderAsyncCallContext
+ private sealed class GetBytesAsyncCallContext : SqlDataReaderAsyncCallContext
{
internal enum OperationMode
{
@@ -5343,7 +5374,7 @@ protected override void Clear()
}
}
- private sealed class GetFieldValueAsyncCallContext : SqlDataReaderAsyncCallContext
+ private sealed class GetFieldValueAsyncCallContext : SqlDataReaderAsyncCallContext
{
private static readonly Func> s_execute = SqlDataReader.GetFieldValueAsyncExecute;
@@ -5351,9 +5382,9 @@ private sealed class GetFieldValueAsyncCallContext : SqlDataReaderAsyncCallCo
internal GetFieldValueAsyncCallContext() { }
- internal GetFieldValueAsyncCallContext(SqlDataReader reader, TaskCompletionSource source, IDisposable disposable)
- : base(reader, source, disposable)
+ internal GetFieldValueAsyncCallContext(SqlDataReader reader, TaskCompletionSource source, CancellationTokenRegistration disposable)
{
+ Set(reader, source, disposable);
}
protected override void Clear()
@@ -5373,7 +5404,7 @@ protected override void Clear()
///
///
///
- private Task InvokeAsyncCall(SqlDataReaderAsyncCallContext context)
+ private Task InvokeAsyncCall(SqlDataReaderBaseAsyncCallContext context)
{
TaskCompletionSource source = context.Source;
try
@@ -5395,7 +5426,7 @@ private Task InvokeAsyncCall(SqlDataReaderAsyncCallContext context)
else
{
task.ContinueWith(
- continuationAction: SqlDataReaderAsyncCallContext.s_completeCallback,
+ continuationAction: SqlDataReaderBaseAsyncCallContext.s_completeCallback,
state: context,
TaskScheduler.Default
);
@@ -5420,7 +5451,7 @@ private Task InvokeAsyncCall(SqlDataReaderAsyncCallContext context)
///
///
///
- private Task ExecuteAsyncCall(SqlDataReaderAsyncCallContext context)
+ private Task ExecuteAsyncCall(AAsyncBaseCallContext context)
{
// _networkPacketTaskSource could be null if the connection was closed
// while an async invocation was outstanding.
@@ -5433,7 +5464,7 @@ private Task ExecuteAsyncCall(SqlDataReaderAsyncCallContext context)
else
{
return completionSource.Task.ContinueWith(
- continuationFunction: SqlDataReaderAsyncCallContext.s_executeCallback,
+ continuationFunction: SqlDataReaderBaseAsyncCallContext.s_executeCallback,
state: context,
TaskScheduler.Default
).Unwrap();
@@ -5449,7 +5480,7 @@ private Task ExecuteAsyncCall(SqlDataReaderAsyncCallContext context)
///
///
///
- private Task ContinueAsyncCall(Task task, SqlDataReaderAsyncCallContext context)
+ private Task ContinueAsyncCall(Task task, SqlDataReaderBaseAsyncCallContext context)
{
// this function must be an instance function called from the static callback because otherwise a compiler error
// is caused by accessing the _cancelAsyncOnCloseToken field of a MarshalByRefObject derived class
@@ -5509,7 +5540,7 @@ private Task ContinueAsyncCall(Task task, SqlDataReaderAsyncCallContext
///
///
///
- private void CompleteAsyncCall(Task task, SqlDataReaderAsyncCallContext context)
+ private void CompleteAsyncCall(Task task, SqlDataReaderBaseAsyncCallContext context)
{
TaskCompletionSource source = context.Source;
context.Dispose();
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.cs
index 3c289bb790..680b34079d 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.cs
@@ -81,7 +81,9 @@ public void Initialize()
SqlInternalConnection connection = _connection;
SqlConnection usersConnection = connection.Connection;
SqlClientEventSource.Log.TryTraceEvent("SqlDelegatedTransaction.Initialize | RES | CPOOL | Object Id {0}, Client Connection Id {1}, delegating transaction.", ObjectID, usersConnection?.ClientConnectionId);
+#if !NET6_0_OR_GREATER
RuntimeHelpers.PrepareConstrainedRegions();
+#endif
try
{
if (connection.IsEnlistedInTransaction)
@@ -144,7 +146,9 @@ public byte[] Promote()
{
SqlConnection usersConnection = connection.Connection;
SqlClientEventSource.Log.TryTraceEvent("SqlDelegatedTransaction.Promote | RES | CPOOL | Object Id {0}, Client Connection Id {1}, promoting transaction.", ObjectID, usersConnection?.ClientConnectionId);
+#if !NET6_0_OR_GREATER
RuntimeHelpers.PrepareConstrainedRegions();
+#endif
try
{
lock (connection)
@@ -252,7 +256,9 @@ public void Rollback(SinglePhaseEnlistment enlistment)
{
SqlConnection usersConnection = connection.Connection;
SqlClientEventSource.Log.TryTraceEvent("SqlDelegatedTransaction.Rollback | RES | CPOOL | Object Id {0}, Client Connection Id {1}, rolling back transaction.", ObjectID, usersConnection?.ClientConnectionId);
+#if !NET6_0_OR_GREATER
RuntimeHelpers.PrepareConstrainedRegions();
+#endif
try
{
lock (connection)
@@ -337,9 +343,13 @@ public void SinglePhaseCommit(SinglePhaseEnlistment enlistment)
{
SqlConnection usersConnection = connection.Connection;
SqlClientEventSource.Log.TryTraceEvent("SqlDelegatedTransaction.SinglePhaseCommit | RES | CPOOL | Object Id {0}, Client Connection Id {1}, committing transaction.", ObjectID, usersConnection?.ClientConnectionId);
+#if !NET6_0_OR_GREATER
RuntimeHelpers.PrepareConstrainedRegions();
+#endif
try
{
+ Exception commitException = null;
+
lock (connection)
{
// If the connection is doomed, we can be certain that the
@@ -354,7 +364,6 @@ public void SinglePhaseCommit(SinglePhaseEnlistment enlistment)
}
else
{
- Exception commitException;
try
{
// Now that we've acquired the lock, make sure we still have valid state for this operation.
@@ -364,7 +373,6 @@ public void SinglePhaseCommit(SinglePhaseEnlistment enlistment)
_connection = null; // Set prior to ExecuteTransaction call in case this initiates a TransactionEnd event
connection.ExecuteTransaction(SqlInternalConnection.TransactionRequest.Commit, null, System.Data.IsolationLevel.Unspecified, _internalTransaction, true);
- commitException = null;
}
catch (SqlException e)
{
@@ -412,13 +420,14 @@ public void SinglePhaseCommit(SinglePhaseEnlistment enlistment)
}
connection.CleanupConnectionOnTransactionCompletion(_atomicTransaction);
- if (commitException == null)
- {
- // connection.ExecuteTransaction succeeded
- enlistment.Committed();
- }
}
}
+
+ if (commitException == null)
+ {
+ // connection.ExecuteTransaction succeeded
+ enlistment.Committed();
+ }
}
catch (System.OutOfMemoryException e)
{
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs
index 83bf554c2c..49c0883e3d 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs
@@ -1235,7 +1235,7 @@ private void CompleteLogin(bool enlistOK)
// for non-pooled connections, enlist in a distributed transaction
// if present - and user specified to enlist
- if (enlistOK && ConnectionOptions.Enlist)
+ if (enlistOK && ConnectionOptions.Enlist && RoutingInfo == null)
{
_parser._physicalStateObj.SniContext = SniContext.Snix_AutoEnlist;
Transaction tx = ADP.GetCurrentTransaction();
@@ -2283,7 +2283,9 @@ internal bool TryGetFedAuthTokenLocked(SqlFedAuthInfo fedAuthInfo, DbConnectionP
bool authenticationContextLocked = false;
// Prepare CER to ensure the lock on authentication context is released.
+#if !NET6_0_OR_GREATER
RuntimeHelpers.PrepareConstrainedRegions();
+#endif
try
{
// Try to obtain a lock on the context. If acquired, this thread got the opportunity to update.
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlTransaction.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlTransaction.cs
index 1c3df017dd..07472db42b 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlTransaction.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlTransaction.cs
@@ -119,7 +119,11 @@ public override void Rollback()
}
///
+#if NET6_0_OR_GREATER
+ public override void Rollback(string transactionName)
+#else
public void Rollback(string transactionName)
+#endif
{
using (DiagnosticTransactionScope diagnosticScope = s_diagnosticListener.CreateTransactionRollbackScope(_isolationLevel, _connection, InternalTransaction, transactionName))
{
@@ -151,7 +155,11 @@ public void Rollback(string transactionName)
}
///
+#if NET6_0_OR_GREATER
+ public override void Save(string savePointName)
+#else
public void Save(string savePointName)
+#endif
{
ZombieCheck();
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
index 36ecb2cd72..17327f16e1 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
@@ -259,6 +259,8 @@ internal EncryptionOptions EncryptionOptions
}
}
+ internal bool Is2005OrNewer => true;
+
internal bool Is2008OrNewer
{
get
@@ -365,10 +367,12 @@ internal void Connect(
bool withFailover)
{
SqlConnectionEncryptOption encrypt = connectionOptions.Encrypt;
+ bool isTlsFirst = (encrypt == SqlConnectionEncryptOption.Strict);
bool trustServerCert = connectionOptions.TrustServerCertificate;
bool integratedSecurity = connectionOptions.IntegratedSecurity;
SqlAuthenticationMethod authType = connectionOptions.Authentication;
string hostNameInCertificate = connectionOptions.HostNameInCertificate;
+ string serverCertificateFilename = connectionOptions.ServerCertificate;
if (_state != TdsParserState.Closed)
{
@@ -414,8 +418,8 @@ internal void Connect(
SqlClientEventSource.Log.TryTraceEvent("TdsParser.Connect | SEC | SSPI or Active Directory Authentication Library loaded for SQL Server based integrated authentication");
}
- // if Strict encryption is chosen trust server certificate should always be false.
- if (encrypt == SqlConnectionEncryptOption.Strict)
+ // if Strict encryption (i.e. isTlsFirst) is chosen trust server certificate should always be false.
+ if (isTlsFirst)
{
trustServerCert = false;
}
@@ -439,10 +443,23 @@ internal void Connect(
_connHandler.pendingSQLDNSObject = null;
// AD Integrated behaves like Windows integrated when connecting to a non-fedAuth server
- _physicalStateObj.CreatePhysicalSNIHandle(serverInfo.ExtendedServerName, ignoreSniOpenTimeout, timerExpire, out instanceName, ref _sniSpnBuffer,
- false, true, fParallel, _connHandler.ConnectionOptions.IPAddressPreference, FQDNforDNSCache, ref _connHandler.pendingSQLDNSObject, serverInfo.ServerSPN,
- integratedSecurity || authType == SqlAuthenticationMethod.ActiveDirectoryIntegrated, encrypt == SqlConnectionEncryptOption.Strict,
- hostNameInCertificate);
+ _physicalStateObj.CreatePhysicalSNIHandle(
+ serverInfo.ExtendedServerName,
+ ignoreSniOpenTimeout,
+ timerExpire,
+ out instanceName,
+ ref _sniSpnBuffer,
+ false,
+ true,
+ fParallel,
+ _connHandler.ConnectionOptions.IPAddressPreference,
+ FQDNforDNSCache,
+ ref _connHandler.pendingSQLDNSObject,
+ serverInfo.ServerSPN,
+ integratedSecurity || authType == SqlAuthenticationMethod.ActiveDirectoryIntegrated,
+ isTlsFirst,
+ hostNameInCertificate,
+ serverCertificateFilename);
if (TdsEnums.SNI_SUCCESS != _physicalStateObj.Status)
{
@@ -501,15 +518,21 @@ internal void Connect(
}
SqlClientEventSource.Log.TryTraceEvent(" Sending prelogin handshake");
- SendPreLoginHandshake(instanceName, encrypt, integratedSecurity);
+ SendPreLoginHandshake(instanceName, encrypt, integratedSecurity, serverCertificateFilename);
_connHandler.TimeoutErrorInternal.EndPhase(SqlConnectionTimeoutErrorPhase.SendPreLoginHandshake);
_connHandler.TimeoutErrorInternal.SetAndBeginPhase(SqlConnectionTimeoutErrorPhase.ConsumePreLoginHandshake);
_physicalStateObj.SniContext = SniContext.Snix_PreLogin;
SqlClientEventSource.Log.TryTraceEvent(" Consuming prelogin handshake");
- PreLoginHandshakeStatus status = ConsumePreLoginHandshake(encrypt, trustServerCert, integratedSecurity, out marsCapable,
- out _connHandler._fedAuthRequired, encrypt == SqlConnectionEncryptOption.Strict);
+ PreLoginHandshakeStatus status = ConsumePreLoginHandshake(
+ encrypt,
+ trustServerCert,
+ integratedSecurity,
+ out marsCapable,
+ out _connHandler._fedAuthRequired,
+ isTlsFirst,
+ serverCertificateFilename);
if (status == PreLoginHandshakeStatus.InstanceFailure)
{
@@ -519,8 +542,22 @@ internal void Connect(
// On Instance failure re-connect and flush SNI named instance cache.
_physicalStateObj.SniContext = SniContext.Snix_Connect;
- _physicalStateObj.CreatePhysicalSNIHandle(serverInfo.ExtendedServerName, ignoreSniOpenTimeout, timerExpire, out instanceName, ref _sniSpnBuffer, true, true, fParallel,
- _connHandler.ConnectionOptions.IPAddressPreference, FQDNforDNSCache, ref _connHandler.pendingSQLDNSObject, serverInfo.ServerSPN, integratedSecurity);
+ _physicalStateObj.CreatePhysicalSNIHandle(
+ serverInfo.ExtendedServerName,
+ ignoreSniOpenTimeout,
+ timerExpire, out instanceName,
+ ref _sniSpnBuffer,
+ true,
+ true,
+ fParallel,
+ _connHandler.ConnectionOptions.IPAddressPreference,
+ FQDNforDNSCache,
+ ref _connHandler.pendingSQLDNSObject,
+ serverInfo.ServerSPN,
+ integratedSecurity,
+ isTlsFirst,
+ hostNameInCertificate,
+ serverCertificateFilename);
if (TdsEnums.SNI_SUCCESS != _physicalStateObj.Status)
{
@@ -540,9 +577,15 @@ internal void Connect(
_physicalStateObj.AssignPendingDNSInfo(serverInfo.UserProtocol, FQDNforDNSCache, ref _connHandler.pendingSQLDNSObject);
}
- SendPreLoginHandshake(instanceName, encrypt, integratedSecurity);
- status = ConsumePreLoginHandshake(encrypt, trustServerCert, integratedSecurity, out marsCapable, out _connHandler._fedAuthRequired,
- encrypt == SqlConnectionEncryptOption.Strict);
+ SendPreLoginHandshake(instanceName, encrypt, integratedSecurity, serverCertificateFilename);
+ status = ConsumePreLoginHandshake(
+ encrypt,
+ trustServerCert,
+ integratedSecurity,
+ out marsCapable,
+ out _connHandler._fedAuthRequired,
+ isTlsFirst,
+ serverCertificateFilename);
// Don't need to check for 7.0 failure, since we've already consumed
// one pre-login packet and know we are connecting to 2000.
@@ -552,6 +595,7 @@ internal void Connect(
throw SQL.InstanceFailure();
}
}
+ SqlClientEventSource.Log.TryTraceEvent(" Prelogin handshake successful");
if (_fMARS && marsCapable)
{
@@ -661,14 +705,15 @@ internal void PutSession(TdsParserStateObject session)
private void SendPreLoginHandshake(
byte[] instanceName,
SqlConnectionEncryptOption encrypt,
- bool integratedSecurity)
+ bool integratedSecurity,
+ string serverCertificateFilename)
{
if (encrypt == SqlConnectionEncryptOption.Strict)
{
//Always validate the certificate when in strict encryption mode
uint info = TdsEnums.SNI_SSL_VALIDATE_CERTIFICATE | TdsEnums.SNI_SSL_USE_SCHANNEL_CACHE | TdsEnums.SNI_SSL_SEND_ALPN_EXTENSION;
- EnableSsl(info, encrypt, integratedSecurity);
+ EnableSsl(info, encrypt, integratedSecurity, serverCertificateFilename);
// Since encryption has already been negotiated, we need to set encryption not supported in
// prelogin so that we don't try to negotiate encryption again during ConsumePreLoginHandshake.
@@ -829,7 +874,7 @@ private void SendPreLoginHandshake(
_physicalStateObj.WritePacket(TdsEnums.HARDFLUSH);
}
- private void EnableSsl(uint info, SqlConnectionEncryptOption encrypt, bool integratedSecurity)
+ private void EnableSsl(uint info, SqlConnectionEncryptOption encrypt, bool integratedSecurity, string serverCertificateFilename)
{
uint error = 0;
@@ -841,7 +886,7 @@ private void EnableSsl(uint info, SqlConnectionEncryptOption encrypt, bool integ
info |= TdsEnums.SNI_SSL_IGNORE_CHANNEL_BINDINGS;
}
- error = _physicalStateObj.EnableSsl(ref info, encrypt == SqlConnectionEncryptOption.Strict);
+ error = _physicalStateObj.EnableSsl(ref info, encrypt == SqlConnectionEncryptOption.Strict, serverCertificateFilename);
if (error != TdsEnums.SNI_SUCCESS)
{
@@ -878,7 +923,8 @@ private PreLoginHandshakeStatus ConsumePreLoginHandshake(
bool integratedSecurity,
out bool marsCapable,
out bool fedAuthRequired,
- bool tlsFirst)
+ bool tlsFirst,
+ string serverCert)
{
marsCapable = _fMARS; // Assign default value
fedAuthRequired = false;
@@ -927,6 +973,7 @@ private PreLoginHandshakeStatus ConsumePreLoginHandshake(
int payloadOffset = 0;
int payloadLength = 0;
int option = payload[offset++];
+ bool serverSupportsEncryption = false;
while (option != (byte)PreLoginOptions.LASTOPT)
{
@@ -950,6 +997,13 @@ private PreLoginHandshakeStatus ConsumePreLoginHandshake(
break;
case (int)PreLoginOptions.ENCRYPT:
+ if (tlsFirst)
+ {
+ // Can skip/ignore this option if we are doing TDS 8.
+ offset += 4;
+ break;
+ }
+
payloadOffset = payload[offset++] << 8 | payload[offset++];
payloadLength = payload[offset++] << 8 | payload[offset++];
@@ -963,16 +1017,11 @@ private PreLoginHandshakeStatus ConsumePreLoginHandshake(
LOGIN
} */
+ // Any response other than NOT_SUP means the server supports encryption.
+ serverSupportsEncryption = serverOption != EncryptionOptions.NOT_SUP;
+
switch (_encryptionOption)
{
- case (EncryptionOptions.ON):
- if (serverOption == EncryptionOptions.NOT_SUP)
- {
- _physicalStateObj.AddError(new SqlError(TdsEnums.ENCRYPTION_NOT_SUPPORTED, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, _server, SQLMessage.EncryptionNotSupportedByServer(), "", 0));
- _physicalStateObj.Dispose();
- ThrowExceptionAndWarning(_physicalStateObj);
- }
- break;
case (EncryptionOptions.OFF):
if (serverOption == EncryptionOptions.OFF)
{
@@ -988,8 +1037,9 @@ private PreLoginHandshakeStatus ConsumePreLoginHandshake(
break;
case (EncryptionOptions.NOT_SUP):
- if (!tlsFirst && serverOption == EncryptionOptions.REQ)
+ if (serverOption == EncryptionOptions.REQ)
{
+ // Server requires encryption, but client does not support it.
_physicalStateObj.AddError(new SqlError(TdsEnums.ENCRYPTION_NOT_SUPPORTED, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, _server, SQLMessage.EncryptionNotSupportedByClient(), "", 0));
_physicalStateObj.Dispose();
ThrowExceptionAndWarning(_physicalStateObj);
@@ -997,22 +1047,16 @@ private PreLoginHandshakeStatus ConsumePreLoginHandshake(
break;
default:
- Debug.Fail("Invalid client encryption option detected");
+ // Any other client option needs encryption
+ if (serverOption == EncryptionOptions.NOT_SUP)
+ {
+ _physicalStateObj.AddError(new SqlError(TdsEnums.ENCRYPTION_NOT_SUPPORTED, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, _server, SQLMessage.EncryptionNotSupportedByServer(), "", 0));
+ _physicalStateObj.Dispose();
+ ThrowExceptionAndWarning(_physicalStateObj);
+ }
break;
}
- if (_encryptionOption == EncryptionOptions.ON ||
- _encryptionOption == EncryptionOptions.LOGIN)
- {
- // Validate Certificate if Trust Server Certificate=false and Encryption forced (EncryptionOptions.ON) from Server.
- bool shouldValidateServerCert = (_encryptionOption == EncryptionOptions.ON && !trustServerCert) ||
- (_connHandler._accessTokenInBytes != null && !trustServerCert);
- uint info = (shouldValidateServerCert ? TdsEnums.SNI_SSL_VALIDATE_CERTIFICATE : 0)
- | (is2005OrLater ? TdsEnums.SNI_SSL_USE_SCHANNEL_CACHE : 0);
-
- EnableSsl(info, encrypt, integratedSecurity);
- }
-
break;
case (int)PreLoginOptions.INSTANCE:
@@ -1093,6 +1137,25 @@ private PreLoginHandshakeStatus ConsumePreLoginHandshake(
}
}
+ if (_encryptionOption == EncryptionOptions.ON ||
+ _encryptionOption == EncryptionOptions.LOGIN)
+ {
+ if (!serverSupportsEncryption)
+ {
+ _physicalStateObj.AddError(new SqlError(TdsEnums.ENCRYPTION_NOT_SUPPORTED, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, _server, SQLMessage.EncryptionNotSupportedByServer(), "", 0));
+ _physicalStateObj.Dispose();
+ ThrowExceptionAndWarning(_physicalStateObj);
+ }
+
+ // Validate Certificate if Trust Server Certificate=false and Encryption forced (EncryptionOptions.ON) from Server.
+ bool shouldValidateServerCert = (_encryptionOption == EncryptionOptions.ON && !trustServerCert) ||
+ (_connHandler._accessTokenInBytes != null && !trustServerCert);
+ uint info = (shouldValidateServerCert ? TdsEnums.SNI_SSL_VALIDATE_CERTIFICATE : 0)
+ | (is2005OrLater ? TdsEnums.SNI_SSL_USE_SCHANNEL_CACHE : 0);
+
+ EnableSsl(info, encrypt, integratedSecurity, serverCert);
+ }
+
return PreLoginHandshakeStatus.Successful;
}
@@ -1313,7 +1376,7 @@ internal void ThrowExceptionAndWarning(TdsParserStateObject stateObj, bool calle
// report exception to pending async operation
// before OnConnectionClosed overrides the exception
// due to connection close notification through references
- var taskSource = stateObj._networkPacketTaskSource;
+ TaskCompletionSource