diff --git a/.github/instructions/onebranch-pipeline-design.instructions.md b/.github/instructions/onebranch-pipeline-design.instructions.md
index bcae2464a5..1c848e2493 100644
--- a/.github/instructions/onebranch-pipeline-design.instructions.md
+++ b/.github/instructions/onebranch-pipeline-design.instructions.md
@@ -23,11 +23,11 @@ Both pipelines use the **OneBranch (1ES) governed template** infrastructure and
| # | Package | Dependencies |
|---|---------|-------------|
| 1 | `Microsoft.SqlServer.Server` | — |
-| 2 | `Microsoft.Data.SqlClient.Extensions.Logging` | — |
-| 3 | `Microsoft.Data.SqlClient.Extensions.Abstractions` | `Extensions.Logging` |
-| 4 | `Microsoft.Data.SqlClient` | `Extensions.Logging`, `Extensions.Abstractions` |
-| 5 | `Microsoft.Data.SqlClient.Extensions.Azure` | `Extensions.Abstractions`, `Extensions.Logging` |
-| 6 | `Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider` | `SqlClient`, `Extensions.Logging` |
+| 2 | `Microsoft.Data.SqlClient.Internal.Logging` | — |
+| 3 | `Microsoft.Data.SqlClient.Extensions.Abstractions` | `Internal.Logging` |
+| 4 | `Microsoft.Data.SqlClient` | `Internal.Logging`, `Extensions.Abstractions` |
+| 5 | `Microsoft.Data.SqlClient.Extensions.Azure` | `Extensions.Abstractions`, `Internal.Logging` |
+| 6 | `Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider` | `SqlClient`, `Internal.Logging` |
---
@@ -37,7 +37,7 @@ Both pipelines use the **OneBranch (1ES) governed template** infrastructure and
sequenceDiagram
participant T as Trigger / User
participant P as Pipeline Orchestrator
- participant B1a as Job: Build Extensions.Logging
+ participant B1a as Job: Build Internal.Logging
participant B1c as Job: Build SqlServer.Server
participant B1b as Job: Build Extensions.Abstractions
participant B2a as Job: Build SqlClient
@@ -63,18 +63,18 @@ sequenceDiagram
Note over P: Stage 2 — build_abstractions (dependsOn: build_independent)
P->>B1b: Build DLLs → ESRP sign DLLs → Pack → ESRP sign NuGet (Abstractions)
- Note right of B1b: Downloads: Extensions.Logging artifact
+ Note right of B1b: Downloads: Internal.Logging artifact
B1b-->>P: ✅ Signed .nupkg
Note over P: Stage 3 — build_dependent (dependsOn: build_abstractions)
par Stage 3 jobs (parallel)
P->>B2a: Build + ESRP sign + pack SqlClient
- Note right of B2a: Downloads: Extensions.Logging,
Extensions.Abstractions artifacts
+ Note right of B2a: Downloads: Internal.Logging,
Extensions.Abstractions artifacts
B2a-->>P: ✅ Signed .nupkg + .snupkg
and
P->>B2b: Build DLLs → ESRP sign DLLs → Pack → ESRP sign NuGet (Azure)
- Note right of B2b: Downloads: Extensions.Abstractions,
Extensions.Logging artifacts
+ Note right of B2b: Downloads: Extensions.Abstractions,
Internal.Logging artifacts
B2b-->>P: ✅ Signed .nupkg
end
@@ -85,7 +85,7 @@ sequenceDiagram
V-->>P: ✅ Package validation passed
and
P->>B3: Build + ESRP sign + pack AKV Provider
- Note right of B3: Downloads: SqlClient,
Extensions.Logging artifacts
+ Note right of B3: Downloads: SqlClient,
Internal.Logging artifacts
B3-->>P: ✅ Signed .nupkg
end
@@ -116,7 +116,7 @@ The build phase runs automatically on every CI trigger, scheduled run, or manual
| Job Template | Package | Build Target | Condition |
|--------------|---------|--------------|-----------|
-| `build-signed-csproj-package-job.yml` | `Microsoft.Data.SqlClient.Extensions.Logging` | `BuildLogging` / `PackLogging` | `buildAKVProvider OR buildSqlClient` |
+| `build-signed-csproj-package-job.yml` | `Microsoft.Data.SqlClient.Internal.Logging` | `BuildLogging` / `PackLogging` | `buildAKVProvider OR buildSqlClient` |
| `build-signed-csproj-package-job.yml` | `Microsoft.SqlServer.Server` | `PackSqlServer` | `buildSqlServerServer` |
- **`dependsOn`**: none
@@ -128,18 +128,18 @@ The build phase runs automatically on every CI trigger, scheduled run, or manual
| Job Template | Package | Build Target | Artifact Dependencies |
|--------------|---------|--------------|----------------------|
-| `build-signed-csproj-package-job.yml` | `Microsoft.Data.SqlClient.Extensions.Abstractions` | `BuildAbstractions` / `PackAbstractions` | `Extensions.Logging` |
+| `build-signed-csproj-package-job.yml` | `Microsoft.Data.SqlClient.Extensions.Abstractions` | `BuildAbstractions` / `PackAbstractions` | `Internal.Logging` |
- **Stage condition**: `buildSqlClient = true` (entire stage is excluded when false)
- **`dependsOn`**: `build_independent`
-- Downloads `Microsoft.Data.SqlClient.Extensions.Logging.nupkg` (from Stage 1) pipeline artifact
+- Downloads `Microsoft.Data.SqlClient.Internal.Logging.nupkg` (from Stage 1) pipeline artifact
#### Stage 3 — `build_dependent`: Core Packages (depend on Stage 2)
| Job Template | Package | Build Target | Artifact Dependencies |
|--------------|---------|--------------|----------------------|
-| `build-signed-package-job.yml` | `Microsoft.Data.SqlClient` | *(nuspec-based)* | `Extensions.Logging`, `Extensions.Abstractions` |
-| `build-signed-csproj-package-job.yml` | `Microsoft.Data.SqlClient.Extensions.Azure` | `BuildAzure` / `PackAzure` | `Extensions.Abstractions`, `Extensions.Logging` |
+| `build-signed-package-job.yml` | `Microsoft.Data.SqlClient` | *(nuspec-based)* | `Internal.Logging`, `Extensions.Abstractions` |
+| `build-signed-csproj-package-job.yml` | `Microsoft.Data.SqlClient.Extensions.Azure` | `BuildAzure` / `PackAzure` | `Extensions.Abstractions`, `Internal.Logging` |
- **Stage condition**: `buildSqlClient = true` (entire stage is excluded when false)
- **`dependsOn`**: `build_abstractions`
@@ -151,11 +151,11 @@ The build phase runs automatically on every CI trigger, scheduled run, or manual
| Job Template | Package | Artifact Dependencies |
|--------------|---------|----------------------|
-| `build-akv-official-job.yml` | `Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider` | `SqlClient`, `Extensions.Logging` |
+| `build-akv-official-job.yml` | `Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider` | `SqlClient`, `Internal.Logging` |
- **Stage condition**: `buildAKVProvider AND buildSqlClient` (both must be true)
- **`dependsOn`**: `build_dependent`
-- Downloads `Microsoft.Data.SqlClient.nupkg` (from Stage 3) and `Microsoft.Data.SqlClient.Extensions.Logging.nupkg` (from Stage 1) pipeline artifacts
+- Downloads `Microsoft.Data.SqlClient.nupkg` (from Stage 3) and `Microsoft.Data.SqlClient.Internal.Logging.nupkg` (from Stage 1) pipeline artifacts
- Uses separate ESRP signing credentials (`Signing`-prefixed variables from `esrp-variables-v2` group)
### 4.2 Validation Stage — `mds_package_validation`
@@ -200,7 +200,7 @@ The release stage is gated and only executes on demand when at least one release
| Package | Artifact Name | Publish Job |
|---------|---------------|-------------|
| `Microsoft.SqlServer.Server` | `drop_build_independent_build_package_SqlServer` | `publish_SqlServer_Server` |
-| `Microsoft.Data.SqlClient.Extensions.Logging` | `drop_build_independent_build_package_Logging` | `publish_Logging` |
+| `Microsoft.Data.SqlClient.Internal.Logging` | `drop_build_independent_build_package_Logging` | `publish_Logging` |
| `Microsoft.Data.SqlClient.Extensions.Abstractions` | `drop_build_abstractions_build_package_Abstractions` | `publish_Abstractions` |
| `Microsoft.Data.SqlClient` | `drop_build_dependent_build_package_SqlClient` | `publish_SqlClient` |
| `Microsoft.Data.SqlClient.Extensions.Azure` | `drop_build_dependent_build_package_Azure` | `publish_Extensions_Azure` |
@@ -294,7 +294,7 @@ parameters:
default: false
- name: releaseLogging
- displayName: 'Release Microsoft.Data.SqlClient.Extensions.Logging'
+ displayName: 'Release Microsoft.Data.SqlClient.Internal.Logging'
type: boolean
default: false
@@ -443,7 +443,7 @@ APIScan is configured at **both pipeline level and job level**:
| `ob_sdl_apiscan_enabled` | Enable/disable APIScan for this job (`true`) |
| `ob_sdl_apiscan_softwareFolder` | Path to signed DLLs for scanning |
| `ob_sdl_apiscan_symbolsFolder` | Path to PDBs for scanning |
-| `ob_sdl_apiscan_softwarename` | Package name (e.g., `Microsoft.Data.SqlClient.Extensions.Logging`) |
+| `ob_sdl_apiscan_softwarename` | Package name (e.g., `Microsoft.Data.SqlClient.Internal.Logging`) |
| `ob_sdl_apiscan_versionNumber` | Assembly file version |
Each job copies its signed DLLs and PDBs to a package-specific folder under `$(Build.SourcesDirectory)/apiScan//` after ESRP DLL signing, ensuring APIScan analyzes the correct signed binaries for each package.
diff --git a/.github/prompts/release-notes.prompt.md b/.github/prompts/release-notes.prompt.md
index 8c8202ab15..ca03933236 100644
--- a/.github/prompts/release-notes.prompt.md
+++ b/.github/prompts/release-notes.prompt.md
@@ -19,7 +19,7 @@ This repository ships multiple packages. Only generate release notes for package
| `Microsoft.SqlServer.Server` | `release-notes/MSqlServerServer//` | PR titles/bodies/files referencing `Microsoft.SqlServer.Server` or `src/Microsoft.SqlServer.Server/` |
| `Microsoft.Data.SqlClient.Extensions.Abstractions` | `release-notes/Extensions/Abstractions//` | PR titles/bodies/files referencing `Extensions.Abstractions` |
| `Microsoft.Data.SqlClient.Extensions.Azure` | `release-notes/Extensions/Azure//` | PR titles/bodies/files referencing `Extensions.Azure` |
-| `Microsoft.Data.SqlClient.Extensions.Logging` | `release-notes/Extensions/Logging//` | PR titles/bodies/files referencing `Extensions.Logging` |
+| `Microsoft.Data.SqlClient.Internal.Logging` | `release-notes/Internal/Logging//` | PR titles/bodies/files referencing `Internal.Logging` |
## Version and Dependency Lookup
@@ -32,7 +32,7 @@ Each package has its own versioning and dependency sources. Use these to determi
| `Microsoft.SqlServer.Server` | [tools/props/Versions.props](tools/props/Versions.props) (`SqlServerPackageVersion`) | [SqlServer project file](src/Microsoft.SqlServer.Server/Microsoft.SqlServer.Server.csproj) |
| `Extensions.Abstractions` | [AbstractionsVersions.props](src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/AbstractionsVersions.props) | [Abstractions.csproj](src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj) |
| `Extensions.Azure` | [AzureVersions.props](src/Microsoft.Data.SqlClient.Extensions/Azure/src/AzureVersions.props) | [Azure.csproj](src/Microsoft.Data.SqlClient.Extensions/Azure/src/Azure.csproj) |
-| `Extensions.Logging` | [LoggingVersions.props](src/Microsoft.Data.SqlClient.Extensions/Logging/src/LoggingVersions.props) | [Logging.csproj](src/Microsoft.Data.SqlClient.Extensions/Logging/src/Logging.csproj) |
+| `Internal.Logging` | [LoggingVersions.props](src/Microsoft.Data.SqlClient.Internal/Logging/src/LoggingVersions.props) | [Logging.csproj](src/Microsoft.Data.SqlClient.Internal/Logging/src/Logging.csproj) |
Concrete dependency versions (e.g., `Azure.Core 1.49.0`) are centrally managed in [Directory.Packages.props](Directory.Packages.props). Framework-conditional versions (e.g., `net9.0` vs everything else) are handled by `Condition` attributes in the same file.
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 1311dafa09..fc0bce4f65 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -30,7 +30,7 @@
-->
-
+
diff --git a/build2.proj b/build2.proj
index ec8b32b141..a5fb6b89a2 100644
--- a/build2.proj
+++ b/build2.proj
@@ -47,7 +47,7 @@
PackageVersionLogging
Applies to: BuildMds, BuildMdsUnix, BuildMdsWindows
TestMdsFunctional, TestMdsManual
- Description: Specifies what version of the Microsoft.Data.SqlClient.Logging to use
+ Description: Specifies what version of the Microsoft.Data.SqlClient.Internal.Logging to use
when compiling MDS. If not specified, the version defined in
Directory.Packages.props is used. This argument only has effect if the
ReferenceType argument is set to "Package".
diff --git a/doc/apps/AzureAuthentication/README.md b/doc/apps/AzureAuthentication/README.md
index 20a3c628ba..84f33179a2 100644
--- a/doc/apps/AzureAuthentication/README.md
+++ b/doc/apps/AzureAuthentication/README.md
@@ -9,7 +9,7 @@ The following SqlClient packages are used, either directly or transitively:
- `Microsoft.Data.SqlClient`
- `Microsoft.SqlServer.Server`
-- `Microsoft.Data.SqlClient.Extensions.Logging`
+- `Microsoft.Data.SqlClient.Internal.Logging`
- `Microsoft.Data.SqlClient.Extensions.Abstractions`
- `Microsoft.Data.SqlClient.Extensions.Azure`
- `Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider`
diff --git a/eng/pipelines/jobs/pack-logging-package-ci-job.yml b/eng/pipelines/jobs/pack-logging-package-ci-job.yml
index 4a1a225f8a..dd748cb4b2 100644
--- a/eng/pipelines/jobs/pack-logging-package-ci-job.yml
+++ b/eng/pipelines/jobs/pack-logging-package-ci-job.yml
@@ -68,7 +68,7 @@ jobs:
# The Logging project file to use for all dotnet CLI commands.
- name: project
- value: src/Microsoft.Data.SqlClient.Extensions/Logging/src/Logging.csproj
+ value: src/Microsoft.Data.SqlClient.Internal/Logging/src/Logging.csproj
# The directory where the NuGet packages will be staged before being
# published as pipeline artifacts.
diff --git a/eng/pipelines/onebranch/jobs/build-signed-sqlclient-package-job.yml b/eng/pipelines/onebranch/jobs/build-signed-sqlclient-package-job.yml
index 07da49215d..565abd3683 100644
--- a/eng/pipelines/onebranch/jobs/build-signed-sqlclient-package-job.yml
+++ b/eng/pipelines/onebranch/jobs/build-signed-sqlclient-package-job.yml
@@ -42,7 +42,7 @@ jobs:
# Download the Abstractions and Logging packages from the previous stage into
# packages/ so that they're available via the local NuGet feed when restoring MDS.
- # MDS depends on both Extensions.Abstractions and Extensions.Logging.
+ # MDS depends on both Extensions.Abstractions and Internal.Logging.
- task: DownloadPipelineArtifact@2
displayName: Download Abstractions Package
inputs:
diff --git a/eng/pipelines/onebranch/sqlclient-non-official.yml b/eng/pipelines/onebranch/sqlclient-non-official.yml
index e08e02af10..e1d948b3fe 100644
--- a/eng/pipelines/onebranch/sqlclient-non-official.yml
+++ b/eng/pipelines/onebranch/sqlclient-non-official.yml
@@ -59,9 +59,9 @@ parameters:
type: boolean
default: false
- # Release the Microsoft.Data.SqlClient.Extensions.Logging package.
+ # Release the Microsoft.Data.SqlClient.Internal.Logging package.
- name: releaseLogging
- displayName: Release Microsoft.Data.SqlClient.Extensions.Logging
+ displayName: Release Microsoft.Data.SqlClient.Internal.Logging
type: boolean
default: false
diff --git a/eng/pipelines/onebranch/sqlclient-official.yml b/eng/pipelines/onebranch/sqlclient-official.yml
index 535e397aa1..b3c5fb2fb5 100644
--- a/eng/pipelines/onebranch/sqlclient-official.yml
+++ b/eng/pipelines/onebranch/sqlclient-official.yml
@@ -80,9 +80,9 @@ parameters:
type: boolean
default: false
- # Release the Microsoft.Data.SqlClient.Extensions.Logging package.
+ # Release the Microsoft.Data.SqlClient.Internal.Logging package.
- name: releaseLogging
- displayName: Release Microsoft.Data.SqlClient.Extensions.Logging
+ displayName: Release Microsoft.Data.SqlClient.Internal.Logging
type: boolean
default: false
diff --git a/eng/pipelines/onebranch/stages/build-stages.yml b/eng/pipelines/onebranch/stages/build-stages.yml
index 7ada84288b..0b6962f1af 100644
--- a/eng/pipelines/onebranch/stages/build-stages.yml
+++ b/eng/pipelines/onebranch/stages/build-stages.yml
@@ -63,7 +63,7 @@ stages:
- template: /eng/pipelines/onebranch/jobs/build-signed-csproj-package-job.yml@self
parameters:
packageName: Logging
- packageFullName: Microsoft.Data.SqlClient.Extensions.Logging
+ packageFullName: Microsoft.Data.SqlClient.Internal.Logging
packageVersion: $(effectiveLoggingVersion)
versionProperties: >-
-p:LoggingPackageVersion=$(effectiveLoggingVersion)
@@ -98,7 +98,7 @@ stages:
# ====================================================================
# Stage 2: Abstractions package (depends on Logging from Stage 1)
# Abstractions must build after Logging since it has a package
- # dependency on Extensions.Logging.
+ # dependency on Internal.Logging.
# ====================================================================
- ${{ if eq(parameters.buildSqlClient, true) }}:
- stage: build_abstractions
diff --git a/eng/pipelines/onebranch/stages/release-stages.yml b/eng/pipelines/onebranch/stages/release-stages.yml
index 2a41ca7c5d..762c17b2cb 100644
--- a/eng/pipelines/onebranch/stages/release-stages.yml
+++ b/eng/pipelines/onebranch/stages/release-stages.yml
@@ -142,9 +142,9 @@ stages:
- ${{ if eq(parameters.releaseLogging, true) }}:
- template: /eng/pipelines/onebranch/jobs/publish-nuget-package-job.yml@self
parameters:
- packageName: Microsoft.Data.SqlClient.Extensions.Logging
+ packageName: Microsoft.Data.SqlClient.Internal.Logging
artifactName: drop_build_independent_build_package_Logging
- packagePath: Microsoft.Data.SqlClient.Extensions.Logging.$(effectiveLoggingVersion).nupkg
+ packagePath: Microsoft.Data.SqlClient.Internal.Logging.$(effectiveLoggingVersion).nupkg
nugetServiceConnection: $(NuGetServiceConnection)
isProduction: ${{ parameters.isOfficial }}
isDryRun: ${{ parameters.isDryRun }}
diff --git a/eng/pipelines/stages/build-logging-package-ci-stage.yml b/eng/pipelines/stages/build-logging-package-ci-stage.yml
index 8ca9928bb7..6b5f22feeb 100644
--- a/eng/pipelines/stages/build-logging-package-ci-stage.yml
+++ b/eng/pipelines/stages/build-logging-package-ci-stage.yml
@@ -9,13 +9,13 @@
#
# The NuGet packages have the following properties:
#
-# Name: Microsoft.Data.SqlClient.Extensions.Logging
+# Name: Microsoft.Data.SqlClient.Internal.Logging
# Version: (from parameter)
#
# The following NuGet packages are published:
#
-# Microsoft.Data.SqlClient.Extensions.Logging..nupkg
-# Microsoft.Data.SqlClient.Extensions.Logging..snupkg (symbols)
+# Microsoft.Data.SqlClient.Internal.Logging..nupkg
+# Microsoft.Data.SqlClient.Internal.Logging..snupkg (symbols)
#
# The packages are published to pipeline artifacts with the name specified by
# the loggingArtifactsName parameter.
diff --git a/release-notes/Extensions/Logging/1.0/1.0.0-preview1.md b/release-notes/Extensions/Logging/1.0/1.0.0-preview1.md
index e97fd8a78b..5f5e44be15 100644
--- a/release-notes/Extensions/Logging/1.0/1.0.0-preview1.md
+++ b/release-notes/Extensions/Logging/1.0/1.0.0-preview1.md
@@ -1,10 +1,13 @@
# Release Notes
+> **Note:** This package is for internal use by other Microsoft.Data.SqlClient packages only
+> and should not be referenced directly by application code.
+
## Preview Release 1.0.0-preview1.26064.3 - 2026-03-05
### Added
-- Initial release of `Microsoft.Data.SqlClient.Extensions.Logging`, providing shared logging infrastructure for use by `Microsoft.Data.SqlClient` and its extension packages.
+- Initial release of `Microsoft.Data.SqlClient.Extensions.Logging`, providing shared logging infrastructure for internal use by `Microsoft.Data.SqlClient` and its extension packages.
([#3626](https://github.com/dotnet/SqlClient/pull/3626),
[#3628](https://github.com/dotnet/SqlClient/pull/3628),
[#3967](https://github.com/dotnet/SqlClient/pull/3967))
diff --git a/release-notes/Extensions/Logging/1.0/README.md b/release-notes/Extensions/Logging/1.0/README.md
index 0d4860dc5a..b31406665b 100644
--- a/release-notes/Extensions/Logging/1.0/README.md
+++ b/release-notes/Extensions/Logging/1.0/README.md
@@ -1,5 +1,8 @@
# Microsoft.Data.SqlClient.Extensions.Logging 1.0 Releases
+> **Note:** This package is for internal use by other Microsoft.Data.SqlClient packages only
+> and should not be referenced directly by application code.
+
The following `Microsoft.Data.SqlClient.Extensions.Logging`
1.0 releases have been shipped:
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj
index e87452a511..b93c296f70 100644
--- a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj
+++ b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj
@@ -106,10 +106,10 @@
depending on our build parameters.
-->
-
+
-
+
-
+
-
+
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Azure/src/PackageReadme.md b/src/Microsoft.Data.SqlClient.Extensions/Azure/src/PackageReadme.md
index c3fdad2018..60015f87df 100644
--- a/src/Microsoft.Data.SqlClient.Extensions/Azure/src/PackageReadme.md
+++ b/src/Microsoft.Data.SqlClient.Extensions/Azure/src/PackageReadme.md
@@ -142,5 +142,5 @@ This package is licensed under the [MIT License](https://licenses.nuget.org/MIT)
- [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) - The main SqlClient driver
- [Microsoft.Data.SqlClient.Extensions.Abstractions](https://www.nuget.org/packages/Microsoft.Data.SqlClient.Extensions.Abstractions) - Core abstractions
-- [Microsoft.Data.SqlClient.Extensions.Logging](https://www.nuget.org/packages/Microsoft.Data.SqlClient.Extensions.Logging) - Logging extensions
+- [Microsoft.Data.SqlClient.Internal.Logging](https://www.nuget.org/packages/Microsoft.Data.SqlClient.Internal.Logging) - Logging internals
- [Azure.Identity](https://www.nuget.org/packages/Azure.Identity) - Azure AD authentication library
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Logging/src/Logging.csproj b/src/Microsoft.Data.SqlClient.Internal/Logging/src/Logging.csproj
similarity index 90%
rename from src/Microsoft.Data.SqlClient.Extensions/Logging/src/Logging.csproj
rename to src/Microsoft.Data.SqlClient.Internal/Logging/src/Logging.csproj
index 1b56016dde..1146e92c8f 100644
--- a/src/Microsoft.Data.SqlClient.Extensions/Logging/src/Logging.csproj
+++ b/src/Microsoft.Data.SqlClient.Internal/Logging/src/Logging.csproj
@@ -27,7 +27,7 @@
- Microsoft.Data.SqlClient.Extensions.Logging
+ Microsoft.Data.SqlClient.Internal.Logging
-
-
+
+
-
+
diff --git a/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/SqlColumnEncryptionAzureKeyVaultProvider.cs b/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/SqlColumnEncryptionAzureKeyVaultProvider.cs
index 08639abe2c..9f716e81fb 100644
--- a/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/SqlColumnEncryptionAzureKeyVaultProvider.cs
+++ b/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/SqlColumnEncryptionAzureKeyVaultProvider.cs
@@ -8,6 +8,7 @@
using Azure.Core;
using Azure.Security.KeyVault.Keys.Cryptography;
using static Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.Validator;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider
{
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 3ad83ed492..6c54000f9c 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
@@ -1092,10 +1092,10 @@
depending on our build parameters.
-->
-
+
-
+
diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj
index cdd54bd244..05a4284565 100644
--- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj
@@ -1076,10 +1076,10 @@
depending on our build parameters.
-->
-
+
-
+
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj
index 0a9ba0431b..d0713280e6 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj
@@ -154,10 +154,10 @@
depending on our build parameters.
-->
-
+
-
+
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs
index d110eebb27..e2a84bad04 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs
@@ -23,6 +23,7 @@
using Microsoft.Data.SqlClient.Connection;
using Microsoft.SqlServer.Server;
using IsolationLevel = System.Data.IsolationLevel;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Reflection;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/ConnectionString/DbConnectionOptions.Debug.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/ConnectionString/DbConnectionOptions.Debug.cs
index 368c351152..2c1a107ba4 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/ConnectionString/DbConnectionOptions.Debug.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/ConnectionString/DbConnectionOptions.Debug.cs
@@ -8,6 +8,7 @@
using System.Globalization;
using System.Text.RegularExpressions;
using Microsoft.Data.SqlClient;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.Common.ConnectionString
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/ConnectionString/DbConnectionString.netfx.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/ConnectionString/DbConnectionString.netfx.cs
index 56af12e08d..dfb383d6b1 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/ConnectionString/DbConnectionString.netfx.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/ConnectionString/DbConnectionString.netfx.cs
@@ -11,6 +11,7 @@
using System.Text;
using Microsoft.Data.Common.ConnectionString;
using Microsoft.Data.SqlClient;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.Common
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/DataException.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/DataException.cs
index b509971c07..6c7ea54a52 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/DataException.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/DataException.cs
@@ -5,6 +5,7 @@
using System;
using System.Diagnostics;
using Microsoft.Data.SqlClient;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/ProviderBase/DbConnectionInternal.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/ProviderBase/DbConnectionInternal.cs
index 197d7a0cfc..b4426bc4d6 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/ProviderBase/DbConnectionInternal.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/ProviderBase/DbConnectionInternal.cs
@@ -13,6 +13,7 @@
using Microsoft.Data.Common.ConnectionString;
using Microsoft.Data.SqlClient;
using Microsoft.Data.SqlClient.ConnectionPool;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Runtime.ConstrainedExecution;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Sql/SqlDataSourceEnumeratorManagedHelper.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Sql/SqlDataSourceEnumeratorManagedHelper.netcore.cs
index 8355d72d6f..2bc42aa38c 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Sql/SqlDataSourceEnumeratorManagedHelper.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Sql/SqlDataSourceEnumeratorManagedHelper.netcore.cs
@@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.Data;
using Microsoft.Data.Sql;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.Server
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Sql/SqlDataSourceEnumeratorNativeHelper.windows.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Sql/SqlDataSourceEnumeratorNativeHelper.windows.cs
index 3dfe29704b..a6325d9990 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Sql/SqlDataSourceEnumeratorNativeHelper.windows.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Sql/SqlDataSourceEnumeratorNativeHelper.windows.cs
@@ -13,6 +13,7 @@
using Microsoft.Data.Common;
using Microsoft.Data.SqlClient;
using static Microsoft.Data.Sql.SqlDataSourceEnumeratorUtil;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.Sql
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Connection/SqlConnectionInternal.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Connection/SqlConnectionInternal.cs
index bdca44b743..b050922be2 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Connection/SqlConnectionInternal.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Connection/SqlConnectionInternal.cs
@@ -19,6 +19,7 @@
using Microsoft.Data.SqlClient.Connection;
using Microsoft.Data.SqlClient.ConnectionPool;
using IsolationLevel = System.Data.IsolationLevel;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.Connection
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/ChannelDbConnectionPool.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/ChannelDbConnectionPool.cs
index 8e863cd711..63815e8200 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/ChannelDbConnectionPool.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/ChannelDbConnectionPool.cs
@@ -15,6 +15,7 @@
using Microsoft.Data.Common.ConnectionString;
using Microsoft.Data.ProviderBase;
using static Microsoft.Data.SqlClient.ConnectionPool.DbConnectionPoolState;
+using Microsoft.Data.SqlClient.Internal;
#nullable enable
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolGroup.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolGroup.cs
index 3870b11ed6..786f91684b 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolGroup.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolGroup.cs
@@ -10,6 +10,7 @@
using Microsoft.Data.Common;
using Microsoft.Data.Common.ConnectionString;
using Microsoft.Data.ProviderBase;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ConnectionPool
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/SqlConnectionPoolGroupProviderInfo.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/SqlConnectionPoolGroupProviderInfo.cs
index b83a2be4bb..b946d839a8 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/SqlConnectionPoolGroupProviderInfo.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/SqlConnectionPoolGroupProviderInfo.cs
@@ -4,6 +4,7 @@
using System.Security;
using Microsoft.Data.Common.ConnectionString;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ConnectionPool
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/TransactedConnectionPool.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/TransactedConnectionPool.cs
index 3132d310d1..7245164f2c 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/TransactedConnectionPool.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/TransactedConnectionPool.cs
@@ -6,6 +6,7 @@
using System.Diagnostics;
using System.Transactions;
using Microsoft.Data.ProviderBase;
+using Microsoft.Data.SqlClient.Internal;
#nullable enable
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/WaitHandleDbConnectionPool.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/WaitHandleDbConnectionPool.cs
index 0db4ed6f63..194054e58e 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/WaitHandleDbConnectionPool.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/WaitHandleDbConnectionPool.cs
@@ -16,6 +16,7 @@
using Microsoft.Data.Common.ConnectionString;
using Microsoft.Data.ProviderBase;
using static Microsoft.Data.SqlClient.ConnectionPool.DbConnectionPoolState;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ConnectionPool
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Diagnostics/SqlClientMetrics.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Diagnostics/SqlClientMetrics.cs
index c73e80243c..ed27a9591f 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Diagnostics/SqlClientMetrics.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Diagnostics/SqlClientMetrics.cs
@@ -4,6 +4,7 @@
using System;
using System.Diagnostics.Tracing;
+using Microsoft.Data.SqlClient.Internal;
#if NET
using System.Threading;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalAppContextSwitches.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalAppContextSwitches.cs
index 74fd226728..7694092907 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalAppContextSwitches.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalAppContextSwitches.cs
@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System;
+using Microsoft.Data.SqlClient.Internal;
#nullable enable
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalDb/LocalDbApi.windows.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalDb/LocalDbApi.windows.cs
index 9a922c3286..787b3b72e4 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalDb/LocalDbApi.windows.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalDb/LocalDbApi.windows.cs
@@ -12,6 +12,7 @@
using System.Text;
using Interop.Windows.Kernel32;
using Interop.Windows.Sni;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Collections.Generic;
@@ -27,7 +28,7 @@ internal static class LocalDbApi
private const string LocalDbPrefix = @"(localdb)\";
private const string LocalDbPrefixNamedPipe = @"np:\\.\pipe\LOCALDB#";
-
+
// Flag for LocalDbFormatMessage that indicates that message can be truncated if it does
// not fit in the buffer.
private const uint LocalDbTruncateErrorMessage = 1;
@@ -35,9 +36,9 @@ internal static class LocalDbApi
#if NETFRAMEWORK
private const string PartialTrustFlagKey = "ALLOW_LOCALDB_IN_PARTIAL_TRUST";
#endif
-
+
private static readonly object s_dllLock = new object();
-
+
#if NETFRAMEWORK
private static readonly object s_configLock = new object();
#endif
@@ -46,7 +47,7 @@ internal static class LocalDbApi
// This is copy of handle that SNI maintains, so we are responsible for freeing it -
// therefore there we are not using SafeHandle
private static IntPtr s_userInstanceDllHandle = IntPtr.Zero;
-
+
#if NETFRAMEWORK
private static Dictionary s_configurableInstances;
private static PermissionSet s_fullTrust;
@@ -63,7 +64,7 @@ private delegate int LocalDbCreateInstanceDelegate(
[MarshalAs(UnmanagedType.LPWStr)] string instance,
uint flags);
#endif
-
+
[SuppressUnmanagedCodeSecurity]
[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
private delegate int LocalDbFormatMessageDelegate(
@@ -72,7 +73,7 @@ private delegate int LocalDbFormatMessageDelegate(
uint dwLanguageId,
StringBuilder buffer,
ref uint bufferLength);
-
+
#if NETFRAMEWORK
private static LocalDbCreateInstanceDelegate LocalDbCreateInstance
{
@@ -91,7 +92,7 @@ private static LocalDbCreateInstanceDelegate LocalDbCreateInstance
SqlClientEventSource.Log.TryTraceEvent(" GetProcAddress for LocalDBCreateInstance error 0x{0}", hResult);
throw CreateLocalDbException(errorMessage: StringsHelper.GetString("LocalDB_MethodNotFound"));
}
-
+
s_localDbCreateInstance = (LocalDbCreateInstanceDelegate)Marshal.GetDelegateForFunctionPointer(functionAddr, typeof(LocalDbCreateInstanceDelegate));
}
}
@@ -101,7 +102,7 @@ private static LocalDbCreateInstanceDelegate LocalDbCreateInstance
}
}
#endif
-
+
private static LocalDbFormatMessageDelegate LocalDbFormatMessage
{
get
@@ -120,7 +121,7 @@ private static LocalDbFormatMessageDelegate LocalDbFormatMessage
SqlClientEventSource.Log.TryTraceEvent("LocalDBAPI.LocalDBFormatMessage> GetProcAddress for LocalDBFormatMessage error 0x{0}", hResult);
throw CreateLocalDbException(errorMessage: Strings.LocalDB_MethodNotFound);
}
-
+
s_localDbFormatMessage = Marshal.GetDelegateForFunctionPointer(functionAddr);
}
}
@@ -129,7 +130,7 @@ private static LocalDbFormatMessageDelegate LocalDbFormatMessage
return s_localDbFormatMessage;
}
}
-
+
private static IntPtr UserInstanceDllHandle
{
get
@@ -169,7 +170,7 @@ internal static void AssertLocalDbPermissions()
s_partialTrustAllowed = true;
}
#endif
-
+
#if NETFRAMEWORK
internal static void CreateLocalDbInstance(string instance)
{
@@ -244,7 +245,7 @@ internal static void CreateLocalDbInstance(string instance)
instanceInfo.created = true;
}
#endif
-
+
#if NETFRAMEWORK
internal static void DemandLocalDbPermissions()
{
@@ -270,7 +271,7 @@ internal static void DemandLocalDbPermissions()
}
}
#endif
-
+
// Check if name is in format (localdb)\ and return instance name if it is
// localDB can also have a format of np:\\.\pipe\LOCALDB#\tsql\query
internal static string GetLocalDbInstanceNameFromServerName(string serverName)
@@ -296,7 +297,7 @@ internal static string GetLocalDbInstanceNameFromServerName(string serverName)
}
return null;
}
-
+
internal static string GetLocalDbMessage(int hrCode)
{
Debug.Assert(hrCode < 0, "HRCode does not indicate error");
@@ -340,17 +341,17 @@ internal static string GetLocalDbMessage(int hrCode)
return string.Format(CultureInfo.CurrentCulture, "{0} ({1}).", Strings.LocalDB_UnobtainableMessage, exc.Message);
}
}
-
+
internal static void ReleaseDllHandles()
{
s_userInstanceDllHandle = IntPtr.Zero;
s_localDbFormatMessage = null;
-
+
#if NETFRAMEWORK
s_localDbCreateInstance = null;
#endif
}
-
+
private static SqlException CreateLocalDbException(
string errorMessage,
string instance = null,
@@ -398,7 +399,7 @@ private static SqlException CreateLocalDbException(
return exc;
}
-
+
private static IntPtr LoadProcAddress(string funcName) =>
#if NETFRAMEWORK
Kernel32Safe.GetProcAddress(UserInstanceDllHandle, funcName);
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.windows.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.windows.cs
index 70449314c6..bd45d307a1 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.windows.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.windows.cs
@@ -10,6 +10,7 @@
using Interop.Windows.Handles;
using Interop.Windows.Kernel32;
using Microsoft.Win32;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ManagedSni
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniCommon.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniCommon.netcore.cs
index 640141fabd..c2d3e0073c 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniCommon.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniCommon.netcore.cs
@@ -12,6 +12,7 @@
using System.Text;
using Microsoft.Data.Common;
using Microsoft.Data.ProviderBase;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ManagedSni
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniMarsConnection.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniMarsConnection.netcore.cs
index f10f10e061..240e62666e 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniMarsConnection.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniMarsConnection.netcore.cs
@@ -9,6 +9,7 @@
using System.Diagnostics;
using System.Security.Authentication;
using System.Threading;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ManagedSni
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniMarsHandle.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniMarsHandle.netcore.cs
index 393afe1c94..46063f9484 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniMarsHandle.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniMarsHandle.netcore.cs
@@ -9,6 +9,7 @@
using System.Diagnostics;
using System.Security.Authentication;
using System.Threading;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ManagedSni
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniNetworkStream.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniNetworkStream.netcore.cs
index f939ba4b7e..febe017e83 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniNetworkStream.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniNetworkStream.netcore.cs
@@ -8,6 +8,7 @@
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ManagedSni
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniNpHandle.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniNpHandle.netcore.cs
index 783fd5bd0b..e7ef8ad890 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniNpHandle.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniNpHandle.netcore.cs
@@ -13,6 +13,7 @@
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using Microsoft.Data.ProviderBase;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ManagedSni
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniPacket.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniPacket.netcore.cs
index fbcb74eb0c..aaf72cd54f 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniPacket.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniPacket.netcore.cs
@@ -11,6 +11,7 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ManagedSni
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniProxy.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniProxy.netcore.cs
index 643e567ed6..da6885062d 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniProxy.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniProxy.netcore.cs
@@ -11,6 +11,7 @@
using System.Net.Sockets;
using System.Text;
using Microsoft.Data.ProviderBase;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ManagedSni
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniSslStream.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniSslStream.netcore.cs
index a7fc289d7f..6cb44c4b0e 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniSslStream.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniSslStream.netcore.cs
@@ -9,6 +9,7 @@
using System.Net.Security;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ManagedSni
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniTcpHandle.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniTcpHandle.netcore.cs
index 3bc29c1473..9ce9684235 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniTcpHandle.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniTcpHandle.netcore.cs
@@ -16,6 +16,7 @@
using System.Threading;
using Microsoft.Data.Common;
using Microsoft.Data.ProviderBase;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ManagedSni
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SslOverTdsStream.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SslOverTdsStream.netcore.cs
index 70ee8adea9..ea25c2b9af 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SslOverTdsStream.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SslOverTdsStream.netcore.cs
@@ -10,6 +10,7 @@
using System.IO.Pipes;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ManagedSni
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SsrpClient.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SsrpClient.netcore.cs
index f4665729ed..1582a80bd4 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SsrpClient.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SsrpClient.netcore.cs
@@ -13,6 +13,7 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Data.ProviderBase;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient.ManagedSni
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/AppConfigManager.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/AppConfigManager.cs
index 29cd2273b8..77797e7235 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/AppConfigManager.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/AppConfigManager.cs
@@ -4,6 +4,7 @@
using System;
using System.Configuration;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/Common/SqlRetryLogic.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/Common/SqlRetryLogic.cs
index 389cbd161f..92b342e930 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/Common/SqlRetryLogic.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/Common/SqlRetryLogic.cs
@@ -6,6 +6,7 @@
using System.Diagnostics;
using System.Reflection;
using System.Transactions;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/Common/SqlRetryLogicProvider.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/Common/SqlRetryLogicProvider.cs
index d9d44235b5..366c18d697 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/Common/SqlRetryLogicProvider.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/Common/SqlRetryLogicProvider.cs
@@ -8,6 +8,7 @@
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryFactory.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryFactory.cs
index c04561da46..0bcebdad9a 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryFactory.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryFactory.cs
@@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryLogicLoader.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryLogicLoader.cs
index 88511a8a00..dfc7861dc3 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryLogicLoader.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryLogicLoader.cs
@@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Reflection;
using System.Text.RegularExpressions;
+using Microsoft.Data.SqlClient.Internal;
#if NET
using System.Diagnostics.CodeAnalysis;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryLogicManager.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryLogicManager.cs
index aa20f7b845..3800ddee9a 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryLogicManager.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryLogicManager.cs
@@ -4,6 +4,7 @@
using System;
using System.Diagnostics;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/NegotiateSspiContextProvider.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/NegotiateSspiContextProvider.cs
index 5971d48409..2457de25b0 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/NegotiateSspiContextProvider.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/NegotiateSspiContextProvider.cs
@@ -8,6 +8,7 @@
using System.Buffers;
using System.Diagnostics;
using System.Net.Security;
+using Microsoft.Data.SqlClient.Internal;
#nullable enable
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/SspiContextProvider.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/SspiContextProvider.cs
index a8531ea004..757e57e1c3 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/SspiContextProvider.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/SspiContextProvider.cs
@@ -6,6 +6,7 @@
using System.Buffers;
using System.Diagnostics;
using Microsoft.Data.SqlClient.Connection;
+using Microsoft.Data.SqlClient.Internal;
#nullable enable
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAppContextSwitchManager.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAppContextSwitchManager.netcore.cs
index e9a73c5704..9af748c3d5 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAppContextSwitchManager.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAppContextSwitchManager.netcore.cs
@@ -6,6 +6,7 @@
using System;
using System.Configuration;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs
index 0e5e7c5201..54468782bd 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs
@@ -8,6 +8,7 @@
using System.Configuration;
using System.IO;
using System.Reflection;
+using Microsoft.Data.SqlClient.Internal;
#nullable enable
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs
index e898b09f50..710d81045f 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs
@@ -16,6 +16,7 @@
using System.Xml;
using Microsoft.Data.Common;
using Microsoft.Data.SqlClient.Connection;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientEventSource.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientEventSource.cs
index fed5b80c33..44897f565c 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientEventSource.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientEventSource.cs
@@ -3,13 +3,14 @@
// See the LICENSE file in the project root for more information.
using Microsoft.Data.SqlClient.Diagnostics;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
///
/// Internal bridge that provides access to SqlClientMetrics from the main driver.
/// The SqlClientEventSource class itself is now defined in the
- /// Microsoft.Data.SqlClient.Extensions.Logging package.
+ /// Microsoft.Data.SqlClient.Internal.Logging package.
///
internal static class SqlClientDiagnostics
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientLogger.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientLogger.cs
index 4af64594ef..3bc917f4f4 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientLogger.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientLogger.cs
@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.NonQuery.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.NonQuery.cs
index 92263ca577..36d727575c 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.NonQuery.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.NonQuery.cs
@@ -11,6 +11,7 @@
using Microsoft.Data.Common;
using Microsoft.Data.ProviderBase;
using Microsoft.Data.SqlClient.Connection;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Security.Permissions;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
index fcd95d35d9..d9f6c33233 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs
@@ -12,6 +12,7 @@
using Microsoft.Data.Common;
using Microsoft.Data.ProviderBase;
using Microsoft.Data.SqlClient.Connection;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Security.Permissions;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
index d0e2b8cb2b..2a47e1466f 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs
@@ -7,6 +7,7 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Data.Common;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Xml.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Xml.cs
index 38afb87560..c025e1d3b7 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Xml.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Xml.cs
@@ -12,6 +12,7 @@
using Microsoft.Data.ProviderBase;
using Microsoft.Data.SqlClient.Connection;
using Microsoft.Data.SqlClient.Server;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Security.Permissions;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.cs
index 18c531ace7..71845ddeb9 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.cs
@@ -19,6 +19,7 @@
using Microsoft.Data.Sql;
using Microsoft.Data.SqlClient.Connection;
using Microsoft.Data.SqlClient.Diagnostics;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Security.Permissions;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommandSet.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommandSet.cs
index 834055e8f4..8773ab1f96 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommandSet.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommandSet.cs
@@ -10,6 +10,7 @@
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.Data.Common;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnection.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnection.cs
index 19571c55dc..e22988b35d 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnection.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnection.cs
@@ -24,6 +24,7 @@
using Microsoft.Data.SqlClient.ConnectionPool;
using Microsoft.Data.SqlClient.Diagnostics;
using Microsoft.SqlServer.Server;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Runtime.CompilerServices;
using System.Security.Permissions;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionFactory.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionFactory.cs
index 0fd0746665..89be9767d8 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionFactory.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionFactory.cs
@@ -16,6 +16,7 @@
using Microsoft.Data.ProviderBase;
using Microsoft.Data.SqlClient.Connection;
using Microsoft.Data.SqlClient.ConnectionPool;
+using Microsoft.Data.SqlClient.Internal;
#if NET
using System.Runtime.Loader;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataAdapter.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataAdapter.cs
index 01abf3ded7..28c3c965ec 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataAdapter.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataAdapter.cs
@@ -9,6 +9,7 @@
using System.Diagnostics;
using System.Threading;
using Microsoft.Data.Common;
+using Microsoft.Data.SqlClient.Internal;
// NOTE: The current Microsoft.VSDesigner editor attributes are implemented for System.Data.SqlClient, and are not publicly available.
// New attributes that are designed to work with Microsoft.Data.SqlClient and are publicly documented should be included in future.
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataReader.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataReader.cs
index 2567918726..0d6203c08d 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataReader.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataReader.cs
@@ -28,6 +28,7 @@
using Microsoft.Data.SqlClient.DataClassification;
using Microsoft.Data.SqlClient.Server;
using Microsoft.Data.SqlTypes;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.cs
index c463b2aeb4..09c49cde4b 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.cs
@@ -9,6 +9,7 @@
using System.Transactions;
using Microsoft.Data.Common;
using Microsoft.Data.SqlClient.Connection;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs
index d9cd9c798e..83d9753799 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs
@@ -13,6 +13,7 @@
using Microsoft.Data.Common;
using Microsoft.Data.Sql;
using Microsoft.Data.SqlClient.ConnectionPool;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.IO;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyListener.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyListener.cs
index 208b3d6693..306b36b747 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyListener.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyListener.cs
@@ -13,6 +13,7 @@
using Microsoft.Data.Common;
using Microsoft.Data.SqlClient;
using Microsoft.Data.SqlClient.ConnectionPool;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Runtime.CompilerServices;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyUtils.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyUtils.cs
index 9eebc0e141..59b36d23cc 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyUtils.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyUtils.cs
@@ -7,6 +7,7 @@
using System.Diagnostics;
using System.Threading;
using Microsoft.Data.Common;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlError.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlError.cs
index a0d00956e9..188a5651d9 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlError.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlError.cs
@@ -4,6 +4,7 @@
using System;
using Microsoft.Data.Common.ConnectionString;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalTransaction.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalTransaction.cs
index 29dc81de15..bc5f5cbccb 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalTransaction.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalTransaction.cs
@@ -8,6 +8,7 @@
using System.Threading;
using Microsoft.Data.Common;
using Microsoft.Data.SqlClient.Connection;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlTransaction.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlTransaction.cs
index 35bd82cf21..5e654659a1 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlTransaction.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlTransaction.cs
@@ -11,6 +11,7 @@
using Microsoft.Data.Common;
using Microsoft.Data.SqlClient.Connection;
using Microsoft.Data.SqlClient.Diagnostics;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Runtime.CompilerServices;
#endif
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs
index 76e5d775f2..94281b4998 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs
@@ -27,6 +27,7 @@
using Microsoft.Data.SqlClient.Server;
using Microsoft.Data.SqlClient.Utilities;
using Microsoft.SqlServer.Server;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Runtime.CompilerServices;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserSafeHandles.windows.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserSafeHandles.windows.cs
index 4baf3e1b69..ed55a76fbb 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserSafeHandles.windows.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserSafeHandles.windows.cs
@@ -8,6 +8,7 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using Interop.Windows.Sni;
+using Microsoft.Data.SqlClient.Internal;
using Microsoft.Data.SqlClient.LocalDb;
#if NETFRAMEWORK
@@ -94,14 +95,14 @@ override protected bool ReleaseHandle()
private static void ReadDispatcher(IntPtr key, IntPtr packet, uint error)
{
- // This is the app-domain dispatcher for all async read callbacks, It
- // simply gets the state object from the key that it is passed, and
+ // This is the app-domain dispatcher for all async read callbacks, It
+ // simply gets the state object from the key that it is passed, and
// calls the state object's read callback.
Debug.Assert(IntPtr.Zero != key, "no key passed to read callback dispatcher?");
if (IntPtr.Zero != key)
{
// NOTE: we will get a null ref here if we don't get a key that
- // contains a GCHandle to TDSParserStateObject; that is
+ // contains a GCHandle to TDSParserStateObject; that is
// very bad, and we want that to occur so we can catch it.
GCHandle gcHandle = (GCHandle)key;
TdsParserStateObject stateObj = (TdsParserStateObject)gcHandle.Target;
@@ -115,14 +116,14 @@ private static void ReadDispatcher(IntPtr key, IntPtr packet, uint error)
private static void WriteDispatcher(IntPtr key, IntPtr packet, uint error)
{
- // This is the app-domain dispatcher for all async write callbacks, It
- // simply gets the state object from the key that it is passed, and
+ // This is the app-domain dispatcher for all async write callbacks, It
+ // simply gets the state object from the key that it is passed, and
// calls the state object's write callback.
Debug.Assert(IntPtr.Zero != key, "no key passed to write callback dispatcher?");
if (IntPtr.Zero != key)
{
// NOTE: we will get a null ref here if we don't get a key that
- // contains a GCHandle to TDSParserStateObject; that is
+ // contains a GCHandle to TDSParserStateObject; that is
// very bad, and we want that to occur so we can catch it.
GCHandle gcHandle = (GCHandle)key;
TdsParserStateObject stateObj = (TdsParserStateObject)gcHandle.Target;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserSessionPool.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserSessionPool.cs
index 64fd2590a4..e155f71cb3 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserSessionPool.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserSessionPool.cs
@@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using Microsoft.Data.Common;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.Multiplexer.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.Multiplexer.cs
index c76b795416..3565afdb4d 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.Multiplexer.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.Multiplexer.cs
@@ -4,6 +4,7 @@
using System;
using System.Diagnostics;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs
index cf8d6cd524..b7fa5c865b 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs
@@ -16,6 +16,7 @@
using Microsoft.Data.Common;
using Microsoft.Data.ProviderBase;
using Microsoft.Data.SqlClient.ManagedSni;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Runtime.ConstrainedExecution;
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectFactory.windows.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectFactory.windows.cs
index eed5187596..a54873cb21 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectFactory.windows.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectFactory.windows.cs
@@ -6,6 +6,7 @@
#if NET
using Microsoft.Data.SqlClient.ManagedSni;
+using Microsoft.Data.SqlClient.Internal;
#endif
namespace Microsoft.Data.SqlClient
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectManaged.netcore.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectManaged.netcore.cs
index cf9924cc24..c3667fda1c 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectManaged.netcore.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectManaged.netcore.cs
@@ -13,6 +13,7 @@
using System.Threading.Tasks;
using Microsoft.Data.Common;
using Microsoft.Data.ProviderBase;
+using Microsoft.Data.SqlClient.Internal;
#nullable enable
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.windows.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.windows.cs
index d04e3798a7..7812860b5e 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.windows.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.windows.cs
@@ -14,6 +14,7 @@
using Interop.Windows.Sni;
using Microsoft.Data.Common;
using Microsoft.Data.ProviderBase;
+using Microsoft.Data.SqlClient.Internal;
namespace Microsoft.Data.SqlClient
{
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlFileStream.windows.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlFileStream.windows.cs
index 3ec1412714..b1a7f45abb 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlFileStream.windows.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlFileStream.windows.cs
@@ -17,6 +17,7 @@
using Interop.Windows.NtDll;
using Microsoft.Data.Common;
using Microsoft.Data.SqlClient;
+using Microsoft.Data.SqlClient.Internal;
using Microsoft.Win32.SafeHandles;
#if NETFRAMEWORK
diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlTypeWorkarounds.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlTypeWorkarounds.cs
index 1c825bbaef..182f3562eb 100644
--- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlTypeWorkarounds.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlTypeWorkarounds.cs
@@ -9,6 +9,7 @@
using System.Runtime.CompilerServices;
using System.Xml;
using Microsoft.Data.SqlClient;
+using Microsoft.Data.SqlClient.Internal;
#if NETFRAMEWORK
using System.Reflection;
@@ -26,7 +27,7 @@ namespace Microsoft.Data.SqlTypes
internal static class SqlTypeWorkarounds
{
#region Work around inability to access SqlXml.CreateSqlXmlReader
-
+
private static readonly XmlReaderSettings s_defaultXmlReaderSettings = new() { ConformanceLevel = ConformanceLevel.Fragment };
private static readonly XmlReaderSettings s_defaultXmlReaderSettingsCloseInput = new() { ConformanceLevel = ConformanceLevel.Fragment, CloseInput = true };
private static readonly XmlReaderSettings s_defaultXmlReaderSettingsAsyncCloseInput = new() { Async = true, ConformanceLevel = ConformanceLevel.Fragment, CloseInput = true };
@@ -44,14 +45,14 @@ internal static XmlReader SqlXmlCreateSqlXmlReader(Stream stream, bool closeInpu
Debug.Assert(closeInput || !async, "Currently we do not have pre-created settings for !closeInput+async");
XmlReaderSettings settingsToUse = closeInput
- ? async
+ ? async
? s_defaultXmlReaderSettingsAsyncCloseInput
: s_defaultXmlReaderSettingsCloseInput
: s_defaultXmlReaderSettings;
return XmlReader.Create(stream, settingsToUse);
}
-
+
#endregion
#region Work around inability to access SqlDateTime.ToDateTime
@@ -69,7 +70,7 @@ internal static DateTime SqlDateTimeToDateTime(int daypart, int timepart)
const uint MaxTime = SQLTicksPerDay - 1; // = 25919999, 11:59:59:997PM
const long BaseDateTicks = 599266080000000000L;//new DateTime(1900, 1, 1).Ticks;
- // casting to uint wraps negative values to large positive ones above the valid
+ // casting to uint wraps negative values to large positive ones above the valid
// ranges so the lower bound doesn't need to be checked
if ((uint)(daypart + MinDayOffset) > (MaxDay + MinDayOffset) || (uint)timepart > MaxTime)
{
@@ -91,9 +92,9 @@ internal static DateTime SqlDateTimeToDateTime(int daypart, int timepart)
private static Exception ThrowOverflowException() => throw SQL.DateTimeOverflow();
#endregion
-
+
#if NETFRAMEWORK
-
+
#region Work around inability to access `new SqlBinary(byte[], bool)`
// Documentation of internal constructor:
@@ -103,9 +104,9 @@ internal static DateTime SqlDateTimeToDateTime(int daypart, int timepart)
internal static SqlBinary ByteArrayToSqlBinary(byte[] value) =>
ByteArrayToSqlBinaryFactory(value);
-
+
#endregion
-
+
#region Work around SqlDecimal.WriteTdsValue not existing in netfx
///
@@ -124,16 +125,16 @@ internal static void SqlDecimalWriteTdsValue(SqlDecimal value, Span outSpa
// SqlDecimal, we cannot use them because they are not documented. The Data property
// is less ideal, but is documented.
Debug.Assert(outSpan.Length == 4, "Output span must be 4 elements long.");
-
+
int[] data = value.Data;
outSpan[0] = (uint)data[0];
outSpan[1] = (uint)data[1];
outSpan[2] = (uint)data[2];
outSpan[3] = (uint)data[3];
}
-
+
#endregion
-
+
#region Work around inability to access `new SqlGuid(byte[], bool)`
// Documentation for internal constructor:
@@ -143,9 +144,9 @@ internal static void SqlDecimalWriteTdsValue(SqlDecimal value, Span outSpa
internal static SqlGuid ByteArrayToSqlGuid(byte[] value) =>
ByteArrayToSqlGuidFactory(value);
-
+
#endregion
-
+
#region Work around inability to access `new SqlMoney(long, int)` and `SqlMoney.ToInternalRepresentation()`
// Documentation for internal ctor:
@@ -156,7 +157,7 @@ internal static SqlGuid ByteArrayToSqlGuid(byte[] value) =>
private delegate long SqlMoneyToLongDelegate(ref SqlMoney @this);
private static readonly SqlMoneyToLongDelegate SqlMoneyToLongFactory =
CreateSqlMoneyToLongFactory();
-
+
///
/// Constructs a SqlMoney from a long value without scaling.
///
@@ -180,7 +181,7 @@ private static SqlMoneyToLongDelegate CreateSqlMoneyToLongFactory()
// we are calling below *is* documented, despite it being internal.
// Documentation for internal method:
// https://learn.microsoft.com/en-us/dotnet/framework/additional-apis/system.data.sqltypes.sqlmoney.tosqlinternalrepresentation
-
+
MethodInfo method = typeof(SqlMoney).GetMethod(
"ToSqlInternalRepresentation",
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.ExactBinding,
@@ -195,7 +196,7 @@ private static SqlMoneyToLongDelegate CreateSqlMoneyToLongFactory()
// Note: We must use something other than default since this cannot be used on
// Null SqlMoney structs.
_ = method.Invoke(SqlMoney.Zero, Array.Empty