You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Fixed expansion of split expression in version numbers.
- Removed addition of PDBs from <AllowedOutputExtensionsInPackageBuildOutputFolder>.
- Removed MDS package ref dependency on Abstractions until pipelines are ready.
- Renamed AbstractionsPackage to Abstractions in targets.
- Updated BUILDGUIDE based on project ref behaviour.
- Added feature branches to CI pipeline triggers.
- Added missing/incomplete paths to the trigger.
- Added dev/* branches to the CI triggers so PRs that target other dev/ branches can run CI.
- Added missing MdsPackageVersion property to signed build pipeline job.
- Commented-out failing NuGet tool installer task.
- Re-ordered Guardian analysis step _before_ build step to avoid clobbering versioned DLLs.
- Added MDS package version to AKV build/package steps.
- Restored AKV nuspec ReferenceType property for AKV Official builds.
- Explicitly building tooling before analysis.
- Fixing validation steps to match XML props files.
- Added PR automation triggers, and documented other pipeline sections.
- Added ReferenceType throughout the MDS/AKV CI build steps.
- Added NuGet.config update to main CI build step for Package reference mode.
- Swapped Abstractions download and NuGet.config update to ensure packages/ exists before attempting to re-configure NuGet.
- Clean target no longer removes packages/
- Uncommented package refs to Abstractions.
- Added separate MDS and AKV project builds to support Package mode.
- Added $ReferenceType$ property to MDS .nuspec like it is for AKV.
Copy file name to clipboardExpand all lines: BUILDGUIDE.md
+35-46Lines changed: 35 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,41 +16,45 @@ Once the environment is setup properly, execute the desired set of commands belo
16
16
17
17
### Targets
18
18
19
+
The following build targets are defined in `build.proj`:
20
+
19
21
|Target|Description|
20
22
|-|-|
21
23
|`BuildAllConfigurations`|Default target. Builds the .NET Framework and .NET drivers for all target frameworks and operating systems.|
24
+
|`BuildAbstractions`|Restore, build, and pack the Abstractions package, publishing the resulting NuGet into `packages/`.|
22
25
|`BuildNetCore`|Builds the .NET driver for all target frameworks.|
23
26
|`BuildNetCoreAllOS`|Builds the .NET driver for all target frameworks and operating systems.|
24
27
|`BuildNetFx`|Builds the .NET Framework driver for all target frameworks.|
25
28
|`BuildTestsNetCore`|Builds tests for the .NET driver.|
26
29
|`BuildTestsNetFx`|Builds tests for the .NET Framework driver.|
27
-
|`Clean`|Cleans generated files.|
28
-
|`Restore`|Restores Nuget packages.|
30
+
|`Clean`|Cleans all generated files.|
31
+
|`Restore`|Restores NuGet packages.|
29
32
|`RunTests`|Runs the unit, functional, and manual tests for the .NET Framework and .NET drivers|
30
33
|`RunUnitTests`|Runs just the unit tests for the .NET Framework and .NET drivers|
31
34
|`RunFunctionalTests`|Runs just the functional tests for the .NET Framework and .NET drivers|
32
35
|`RunManualTests`|Runs just the manual tests for the .NET Framework and .NET drivers|
33
36
|`BuildAkv`|Builds the Azure Key Vault Provider package for all supported platforms.|
34
37
35
-
36
38
### Parameters
39
+
40
+
The following parameters may be defined as MSBuild properties to configure the
41
+
build:
42
+
37
43
|Name|Supported Values|Default|Description|
38
44
|-|-|-|-|
39
45
|`Configuration`|`Debug`, `Release`|`Debug`|Sets the release configuration.|
40
-
|`BuildNetFx`|`true`, `false`|`true` (Windows), `false` (other)|If false, skips building the .NET Framework driver on Windows.|
41
46
|`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.|
42
47
|`Platform`|`AnyCPU`, `x86`, `x64`, `ARM`, `ARM64`|`AnyCPU`|May only be set when using package reference type or running tests.|
43
48
|`TestSet`|`1`, `2`, `3`, `AE`|all|Build or run a subset of the manual tests. Omit (default) to target all tests.|
44
49
|`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\)|
45
50
|`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.|
46
51
|`ResultsDirectory`|An absolute file path|./TestResults relative to current directory|Specifies where to write test results.|
47
52
48
-
49
53
## Example Workflows using MSBuild (Recommended)
54
+
50
55
Using the default configuration and running all tests:
@@ -119,15 +120,13 @@ Manual Tests require the below setup to run:
119
120
|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`. |
120
121
|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`|
121
122
122
-
123
123
## Example workflows using the Dotnet SDK
124
124
125
-
####Run Functional Tests
125
+
### Run Functional Tests
126
126
127
127
- Windows (`netfx x86`):
128
128
129
129
```bash
130
-
msbuild
131
130
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"
132
131
```
133
132
@@ -152,7 +151,8 @@ dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.S
152
151
```bash
153
152
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"
154
153
```
155
-
#### Run Manual Tests
154
+
155
+
### Run Manual Tests
156
156
157
157
- Windows (`netfx x86`):
158
158
@@ -194,35 +194,39 @@ dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlCl
194
194
195
195
Tests can be built and run with custom "Reference Type" property that enables different styles of testing:
196
196
197
-
- "Project" => Build and run tests with Microsoft.Data.SqlClient as Project Reference
198
-
- "Package" => Build and run tests with Microsoft.Data.SqlClient as Package Reference with configured "TestMicrosoftDataSqlClientVersion" in "Versions.props" file.
197
+
- "Project" => Build and run tests with Microsoft.Data.SqlClient as a Project Reference
198
+
- "Package" => Build and run tests with Microsoft.Data.SqlClient as a Package Reference with configured "TestMicrosoftDataSqlClientVersion" in "Versions.props" file.
199
199
200
200
> ************** IMPORTANT NOTE BEFORE PROCEEDING WITH "PACKAGE" REFERENCE TYPE ***************
201
201
> CREATE A NUGET PACKAGE WITH BELOW COMMAND AND ADD TO LOCAL FOLDER + UPDATE NUGET CONFIG FILE TO READ FROM THAT LOCATION
202
202
>
203
203
> ```bash
204
-
>msbuild -p:configuration=Release
204
+
> msbuild -p:Configuration=Release
205
205
>```
206
206
207
207
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.
208
208
209
209
### Building Tests with Reference Type
210
210
211
-
For .NET, all 4 reference types are supported:
211
+
For .NET:
212
212
213
213
```bash
214
+
# Project is the default reference type. The below commands are equivalent:
There may be times where connection cannot be made to SQL Server, we found below ideas helpful:
291
-
292
-
- 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.
293
-
294
-
- 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:
0 commit comments