Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f6bbbaf
User Story 37654: Create Abstractions package
paulmedynski Jul 8, 2025
a530c48
Merge branch 'feat/azure-split' into dev/paul/azure-split/abstractions
paulmedynski Sep 15, 2025
a9aaf95
User Story 37654: Create Abstractions package
paulmedynski Sep 15, 2025
1fc50c9
User Story 37654: Create Abstractions package
paulmedynski Sep 15, 2025
1b1ddec
Optimization: Use Environment.TickCount for SqlStatistics execution t…
SAY14489 Sep 16, 2025
780db73
[7.0.0-preview1] Prepare release notes (#3616)
paulmedynski Sep 16, 2025
1765de5
Merge | TdsParser functional changes (#3555)
edwardneal Sep 16, 2025
6b0c5c2
Fix Debug Assertion in Connection Pool Due to Double Deactivation (#3…
ShreyaLaxminarayan Sep 17, 2025
5d136ea
User Story 37654: Create Abstractions package
paulmedynski Sep 17, 2025
beaf9c3
User Story 37654: Create Abstractions package
paulmedynski Sep 17, 2025
66cd309
User Story 37654: Create Abstractions package
paulmedynski Sep 17, 2025
e472245
Merge | SqlCommand Public Properties (#3611)
benrr101 Sep 17, 2025
994cf81
User Story 37654: Create Abstractions package
paulmedynski Sep 18, 2025
960a6c4
User Story 37654: Create Abstractions package
paulmedynski Sep 18, 2025
dd39ffa
User Story 37654: Create Abstractions package
paulmedynski Sep 18, 2025
11a5e70
User Story 37654: Create Abstractions package
paulmedynski Sep 18, 2025
865cfce
User Story 37654: Create Abstractions package
paulmedynski Sep 18, 2025
2655083
Tests | Expand UDT serialization code coverage (#3423)
edwardneal Sep 18, 2025
600803b
User Story 37654: Create Abstractions package
paulmedynski Sep 18, 2025
327df5e
User Story 37654: Create Abstractions package
paulmedynski Sep 19, 2025
6dcb0db
User Story 37654: Create Abstractions package
paulmedynski Sep 19, 2025
88e95d5
User Story 37654: Create Abstractions package
paulmedynski Sep 19, 2025
5885cf8
User Story 37654: Create Abstractions package
paulmedynski Sep 20, 2025
168755c
User Story 37654: Create Abstractions package
paulmedynski Sep 22, 2025
a18bb4f
User Story 37654: Create Abstractions package
paulmedynski Sep 22, 2025
ddd0ee4
User Story 37654: Create Abstractions package
paulmedynski Sep 22, 2025
307430a
User Story 37654: Create Abstractions package
paulmedynski Sep 22, 2025
aa73678
User Story 37654: Create Abstractions package
paulmedynski Sep 22, 2025
5a35468
User Story 37654: Create Abstractions package
paulmedynski Sep 22, 2025
9f49ffe
User Story 37654: Create Abstractions package
paulmedynski Jul 8, 2025
1b4ee9d
Merge branch 'dev/paul/azure-split/abstractions' of github.com:dotnet…
paulmedynski Sep 22, 2025
50c52c1
User Story 37654: Create Abstractions package
paulmedynski Sep 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ dotnet_diagnostic.xUnit1031.severity=none
dotnet_diagnostic.xUnit1030.severity=none

# Xml files
[*.{xml,csproj,stylecop,resx,ruleset,props,targets,config,nuspec}]
[*.{xml,slnx,proj,csproj,stylecop,resx,ruleset,props,targets,config,nuspec}]
indent_size = 2

# Shell scripts
Expand Down
86 changes: 42 additions & 44 deletions BUILDGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,46 @@ Once the environment is setup properly, execute the desired set of commands belo

### Targets

The following build targets are defined in `build.proj`:

|Target|Description|
|-|-|
|`BuildAllConfigurations`|Default target. Builds the .NET Framework and .NET drivers for all target frameworks and operating systems.|
|`BuildAbstractionsPackage`|Restore, build, and pack the Abstractions package, publishing the resulting NuGet into `packages/`.|
|`BuildNetCore`|Builds the .NET driver for all target frameworks.|
|`BuildNetCoreAllOS`|Builds the .NET driver for all target frameworks and operating systems.|
|`BuildNetFx`|Builds the .NET Framework driver for all target frameworks.|
|`BuildTestsNetCore`|Builds tests for the .NET driver.|
|`BuildTestsNetFx`|Builds tests for the .NET Framework driver.|
|`Clean`|Cleans generated files.|
|`Restore`|Restores Nuget packages.|
|`Clean`|Cleans all generated files.|
|`Restore`|Restores NuGet packages.|
|`RunTests`|Runs the unit, functional, and manual tests for the .NET Framework and .NET drivers|
|`RunUnitTests`|Runs just the unit tests for the .NET Framework and .NET drivers|
|`RunFunctionalTests`|Runs just the functional tests for the .NET Framework and .NET drivers|
|`RunManualTests`|Runs just the manual tests for the .NET Framework and .NET drivers|
|`BuildAkv`|Builds the Azure Key Vault Provider package for all supported platforms.|


### Parameters

The following parameters may be defined as MSBuild properties to configure the
build:

|Name|Supported Values|Default|Description|
|-|-|-|-|
|`Configuration`|`Debug`, `Release`|`Debug`|Sets the release configuration.|
|`BuildNetFx`|`true`, `false`|`true` (Windows), `false` (other)|If false, skips building the .NET Framework driver on Windows.|
|`OSGroup`|`Unix`, `Windows_NT`, `AnyOS`|typically defaults to the client system's OS, unless using `BuildAllConfigurations` or an `AnyOS` specific target|The operating system to target.|
|`Platform`|`AnyCPU`, `x86`, `x64`, `ARM`, `ARM64`|`AnyCPU`|May only be set when using package reference type or running tests.|
|`TestSet`|`1`, `2`, `3`, `AE`|all|Build or run a subset of the manual tests. Omit (default) to target all tests.|
|`DotnetPath`|Absolute file path to an installed `dotnet` version.|The system default specified by the path variable|Set to run tests using a specific dotnet version (e.g. C:\net6-win-x86\)|
|`TF`|`net8.0`, `net462`, `net47`, `net471`, `net472`, `net48`, `net481`|`net8.0` in netcore, `net462` in netfx|Sets the target framework when building or running tests. Not applicable when building the drivers.|
|`ResultsDirectory`|An absolute file path|./TestResults relative to current directory|Specifies where to write test results.|


## Example Workflows using MSBuild (Recommended)

Using the default configuration and running all tests:

```bash
msbuild -t:BuildAbstractionsPackage
msbuild
msbuild -t:BuildTestsNetFx -p:TF=net462
msbuild -t:BuildTestsNetCore
Expand All @@ -59,28 +65,31 @@ msbuild -t:RunTests
Using the Release configuration:

```bash
msbuild -p:configuration=Release
msbuild -t:BuildTestsNetFx -p:TF=net462 -p:configuration=Release
msbuild -t:BuildTestsNetCore -p:configuration=Release
msbuild -t:RunTests -p:configuration=Release
msbuild -t:BuildAbstractionsPackage -p:Configuration=Release
msbuild -p:Configuration=Release
msbuild -t:BuildTestsNetFx -p:TF=net462 -p:Configuration=Release
msbuild -t:BuildTestsNetCore -p:Configuration=Release
msbuild -t:RunTests -p:Configuration=Release
```

Running only the unit tests:

```bash
msbuild -t:BuildAbstractionsPackage
msbuild
msbuild -t:BuildTestsNetFx -p:TF=net462
msbuild -t:BuildTestsNetCore
msbuild -t:RunUnitTests
```

Using a specific dotnet version/architecture:
Using a specific .NET runtime to run tests:

```bash
msbuild -p:configuration=Release
msbuild -t:BuildTestsNetFx -p:TF=net462 -p:configuration=Release
msbuild -t:BuildTestsNetCore -p:configuration=Release
msbuild -t:RunTests -p:configuration=Release -p:DotnetPath=C:\net8-win-x86\
msbuild -t:BuildAbstractionsPackage
msbuild
msbuild -t:BuildTestsNetFx -p:TF=net462
msbuild -t:BuildTestsNetCore
msbuild -t:RunTests -p:DotnetPath=C:\net8-win-x86\
```

### Running Manual Tests
Expand Down Expand Up @@ -119,15 +128,13 @@ Manual Tests require the below setup to run:
|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` |


## Example workflows using the Dotnet SDK

#### Run Functional Tests
### Run Functional Tests

- Windows (`netfx x86`):

```bash
msbuild
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"
```

Expand All @@ -152,7 +159,8 @@ dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.S
```bash
dotnet test "src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj" -p:Platform="AnyCPU" -p:Configuration="Release" -p:TestTargetOS="Unixnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonlinuxtests&category!=nonuaptests"
```
#### Run Manual Tests

### Run Manual Tests

- Windows (`netfx x86`):

Expand Down Expand Up @@ -194,35 +202,40 @@ dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlCl

Tests can be built and run with custom "Reference Type" property that enables different styles of testing:

- "Project" => Build and run tests with Microsoft.Data.SqlClient as Project Reference
- "Package" => Build and run tests with Microsoft.Data.SqlClient as Package Reference with configured "TestMicrosoftDataSqlClientVersion" in "Versions.props" file.
- "Project" => Build and run tests with Microsoft.Data.SqlClient as a Project Reference
- "Package" => Build and run tests with Microsoft.Data.SqlClient as a Package Reference with configured "TestMicrosoftDataSqlClientVersion" in "Versions.props" file.

> ************** IMPORTANT NOTE BEFORE PROCEEDING WITH "PACKAGE" REFERENCE TYPE ***************
> CREATE A NUGET PACKAGE WITH BELOW COMMAND AND ADD TO LOCAL FOLDER + UPDATE NUGET CONFIG FILE TO READ FROM THAT LOCATION
>
> ```bash
> msbuild -p:configuration=Release
> msbuild -t:BuildAbstractionsPackage -p:Configuration=Release
> msbuild -p:Configuration=Release
> ```

A non-AnyCPU platform reference can only be used with package reference type. Otherwise, the specified platform will be replaced with AnyCPU in the build process.

### Building Tests with Reference Type

For .NET, all 4 reference types are supported:
For .NET:

```bash
# Project is the default reference type. The below commands are equivalent:
msbuild -t:BuildTestsNetCore
msbuild -t:BuildTestsNetCore -p:ReferenceType=Project
# Default setting uses Project Reference.

# Package reference type:
msbuild -t:BuildTestsNetCore -p:ReferenceType=Package
```

For .NET Framework, below reference types are supported:
For .NET Framework:

```bash
# Project is the default reference type. The below commands are equivalent:
msbuild -t:BuildTestsNetFx -p:TF=net462
msbuild -t:BuildTestsNetFx -p:TF=net462 -p:ReferenceType=Project
# Default setting uses Project Reference.

# Package reference type:
msbuild -t:BuildTestsNetFx -p:TF=net462 -p:ReferenceType=Package
```

Expand All @@ -241,26 +254,25 @@ Tests can be built and run with custom Target Frameworks. See the below examples
### Building Tests with custom target framework

```bash
msbuild -t:BuildTestsNetFx -p:TF=net462
# Build the tests for custom .NET Framework target
msbuild -t:BuildTestsNetFx -p:TF=net462
```

```bash
msbuild -t:BuildTestsNetCore -p:TF=net8.0
# Build the tests for custom .NET target
msbuild -t:BuildTestsNetCore -p:TF=net8.0
```

### Running Tests with custom target framework (traditional)

```bash
# Run tests with custom .NET Framework target
dotnet test -p:TargetNetFxVersion=net462 ...
# Use above property to run Functional Tests with custom .NET Framework target

# Run tests with custom .NET target
dotnet test -p:TargetNetCoreVersion=net8.0 ...
# Use above property to run Functional Tests with custom .NET target
```


## Using Managed SNI on Windows

Managed SNI can be enabled on Windows by enabling the below AppContext switch:
Expand All @@ -285,20 +297,6 @@ When connecting to a server, if a protocol lower than TLS 1.2 is negotiated, a s

`Switch.Microsoft.Data.SqlClient.SuppressInsecureTLSWarning`

### Troubleshooting Docker issues

There may be times where connection cannot be made to SQL Server, we found below ideas helpful:

- Clear Docker images to create clean image from time-to-time, and clear docker cache if needed by running `docker system prune` in Command Prompt.

- If you face `Microsoft.Data.SqlClient.SNI.dll not found` errors when debugging, try updating the below properties in the netcore\Microsoft.Data.SqlClient.csproj file and try again:

```xml
<OSGroup>Unix</OSGroup>
<TargetsWindows>false</TargetsWindows>
<TargetsUnix>true</TargetsUnix>
```

## Collecting Code Coverage

### Using VSTest
Expand Down
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,68 @@ 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/)

## [Preview Release 7.0.0-preview1.25257.1] - 2025-09-12

This update brings the following changes since the [6.1.0](release-notes/6.1/6.1.0.md)
release:

### Breaking Changes

- Removed `Constrained Execution Region` error handling blocks and associated
`SqlConnection` cleanup which may affect how potentially-broken connections
are expunged from the pool.
([#3535](https://github.com/dotnet/SqlClient/pull/3535))

### Bug Fixes

- Packet multiplexing disabled by default, and several bug fixes.
([#3534](https://github.com/dotnet/SqlClient/pull/3534),
[#3537](https://github.com/dotnet/SqlClient/pull/3537))

### Added

- `SqlColumnEncryptionCertificateStoreProvider` now works on Windows, Linux,
and macOS.
([#3014](https://github.com/dotnet/SqlClient/pull/3014))

### Changed

- Updated `SqlVector.Null` to return a nullable `SqlVector` instance in the
reference API to match the implementation.
([#3521](https://github.com/dotnet/SqlClient/pull/3521))

- Performance improvements for all built-in
`SqlColumnEncryptionKeyStoreProvider` implementations.
([#3554](https://github.com/dotnet/SqlClient/pull/3554))

- Various test improvements.
([#3456](https://github.com/dotnet/SqlClient/pull/3456),
[#2968](https://github.com/dotnet/SqlClient/pull/2968),
[#3458](https://github.com/dotnet/SqlClient/pull/3458),
[#3494](https://github.com/dotnet/SqlClient/pull/3494),
[#3559](https://github.com/dotnet/SqlClient/pull/3559),
[#3575](https://github.com/dotnet/SqlClient/pull/3575))

- Codebase merge project and related cleanup.
([#3436](https://github.com/dotnet/SqlClient/pull/3436),
[#3434](https://github.com/dotnet/SqlClient/pull/3434),
[#3448](https://github.com/dotnet/SqlClient/pull/3448),
[#3454](https://github.com/dotnet/SqlClient/pull/3454),
[#3462](https://github.com/dotnet/SqlClient/pull/3462),
[#3435](https://github.com/dotnet/SqlClient/pull/3435),
[#3492](https://github.com/dotnet/SqlClient/pull/3492),
[#3473](https://github.com/dotnet/SqlClient/pull/3473),
[#3469](https://github.com/dotnet/SqlClient/pull/3469),
[#3394](https://github.com/dotnet/SqlClient/pull/3394),
[#3493](https://github.com/dotnet/SqlClient/pull/3493),
[#3593](https://github.com/dotnet/SqlClient/pull/3593))

- Documentation improvements.
([#3490](https://github.com/dotnet/SqlClient/pull/3490))

- Updated `Azure.Identity` dependency to v1.14.2.
([#3538](https://github.com/dotnet/SqlClient/pull/3538))

## [Stable Release 6.1.1] - 2025-08-14

This update includes the following changes since the [6.1.0](6.1.0.md) release:
Expand Down
21 changes: 20 additions & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>

<!-- Clear all inherited feeds. -->
<clear />
<add key="sqlclient" value="https://sqlclientdrivers.pkgs.visualstudio.com/public/_packaging/sqlclient/nuget/v3/index.json" />

<!--
We do not use the public nuget.org feed. Instead, we use a governed
feed maintained by our SqlClientDrivers ADO organization. Packages must
be individually vetted and added to this feed manually before they will
be available for consumption by our builds.

https://sqlclientdrivers.visualstudio.com/public/_artifacts/feed/sqlclient
-->
<add key="governed" value="https://sqlclientdrivers.pkgs.visualstudio.com/public/_packaging/sqlclient/nuget/v3/index.json" />
</packageSources>

<auditSources>

<!-- Clear all inherited audit sources. -->
<clear />

<!--
There is no governed ADO feed for auditing, so we use the public
nuget.org source.
-->
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</auditSources>
</configuration>
Loading
Loading