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
- Added empty Extensions package with some sample class and docs to demonstrate packaging.
- Created CI stage to build, test, pack, and publish the Extensions NuGet package.
- Updated downstream CI stages/jobs to use the Extensions package.
- Updated build.proj Clean target to not delete packages/ dir.
- Updated BUILDGUIDE with instructions for the Extensions package.
- Cleaned up stale BUIDGUIDE sections.
- Added temporary GitHub Discussion content so the team can review before posting it as a real Discussion.
- Disable .pdb file inclusion in the application package.
- Renamed Extensions package to Abstractions.
- Updated README related to extensions design.
Copy file name to clipboardExpand all lines: BUILDGUIDE.md
+43-44Lines changed: 43 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,40 +16,47 @@ 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
+
|`BuildAbstractionsPackage`|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 generated files, except for NuGet packages published to `packages/`.|
31
+
|`CleanAll`|Cleans all generated files.|
32
+
|`Restore`|Restores NuGet packages.|
29
33
|`RunTests`|Runs the unit, functional, and manual tests for the .NET Framework and .NET drivers|
30
34
|`RunUnitTests`|Runs just the unit tests for the .NET Framework and .NET drivers|
31
35
|`RunFunctionalTests`|Runs just the functional tests for the .NET Framework and .NET drivers|
32
36
|`RunManualTests`|Runs just the manual tests for the .NET Framework and .NET drivers|
33
37
|`BuildAkv`|Builds the Azure Key Vault Provider package for all supported platforms.|
34
38
35
-
36
39
### Parameters
40
+
41
+
The following parameters may be defined as MSBuild properties to configure the
42
+
build:
43
+
37
44
|Name|Supported Values|Default|Description|
38
45
|-|-|-|-|
39
46
|`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
47
|`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
48
|`Platform`|`AnyCPU`, `x86`, `x64`, `ARM`, `ARM64`|`AnyCPU`|May only be set when using package reference type or running tests.|
43
49
|`TestSet`|`1`, `2`, `3`, `AE`|all|Build or run a subset of the manual tests. Omit (default) to target all tests.|
44
50
|`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
51
|`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
52
|`ResultsDirectory`|An absolute file path|./TestResults relative to current directory|Specifies where to write test results.|
47
53
48
-
49
54
## Example Workflows using MSBuild (Recommended)
55
+
50
56
Using the default configuration and running all tests:
@@ -119,15 +129,13 @@ Manual Tests require the below setup to run:
119
129
|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
130
|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
131
122
-
123
132
## Example workflows using the Dotnet SDK
124
133
125
-
####Run Functional Tests
134
+
### Run Functional Tests
126
135
127
136
- Windows (`netfx x86`):
128
137
129
138
```bash
130
-
msbuild
131
139
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
140
```
133
141
@@ -152,7 +160,8 @@ dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.S
152
160
```bash
153
161
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
162
```
155
-
#### Run Manual Tests
163
+
164
+
### Run Manual Tests
156
165
157
166
- Windows (`netfx x86`):
158
167
@@ -194,35 +203,40 @@ dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlCl
194
203
195
204
Tests can be built and run with custom "Reference Type" property that enables different styles of testing:
196
205
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.
206
+
- "Project" => Build and run tests with Microsoft.Data.SqlClient as a Project Reference
207
+
- "Package" => Build and run tests with Microsoft.Data.SqlClient as a Package Reference with configured "TestMicrosoftDataSqlClientVersion" in "Versions.props" file.
199
208
200
209
> ************** IMPORTANT NOTE BEFORE PROCEEDING WITH "PACKAGE" REFERENCE TYPE ***************
201
210
> CREATE A NUGET PACKAGE WITH BELOW COMMAND AND ADD TO LOCAL FOLDER + UPDATE NUGET CONFIG FILE TO READ FROM THAT LOCATION
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
218
209
219
### Building Tests with Reference Type
210
220
211
-
For .NET, all 4 reference types are supported:
221
+
For .NET:
212
222
213
223
```bash
224
+
# 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