@@ -20,9 +20,8 @@ on operating systems that do not support .NET Framework. As such, it is not nece
2020no action is required. On Linux and MacOS systems, the ` pwsh ` command is required to be in the ` $PATH ` environment
2121variable. For specific instructions see: [ Install PowerShell] ( https://learn.microsoft.com/en-us/powershell/scripting/install/install-powershell )
2222
23- The ** NuGet** binary is required to package the Microsoft.Data.SqlClient project. For convenience, this can be be done
24- via the PowerShell script [ tools/scripts/downloadLatestNuget.ps1] ( tools/scripts/downloadLatestNuget.ps1 ) , however, any
25- ` nuget.exe ` binary can be used.
23+ The ** NuGet** binary is optional for inspection and feed-management workflows, but build and packaging flows in this
24+ repository are run through ` dotnet build ` against ` build.proj ` .
2625
2726## Developer Workflow
2827
@@ -35,20 +34,18 @@ package the project. The `build.proj` file provides convenient targets to accomp
3534> is recommended that ` build.proj ` is used for local development, as well.
3635
3736> [ !TIP]
38- > ` build.proj ` was written with the intention of being called from ` msbuild ` . As such, the following examples below
39- > use ` msbuild ` . On systems where ` msbuild ` is not available, simply replace ` msbuild ` with ` dotnet msbuild ` to get the
40- > same behavior.
37+ > Use ` dotnet build ` with ` build.proj ` for local and CI workflows in this repository.
4138
4239> [ !TIP]
4340> This section is not exhaustive of all targets or parameters to ` build.proj ` . Complete documentation is avilable in
4441> [ ` build.proj ` ] ( build.proj ) .
4542
4643### Building Projects
4744
48- From the root of your repository, run ` msbuild ` against ` build.proj ` with a build target, following this pattern:
45+ From the root of your repository, run ` dotnet build ` against ` build.proj ` with a build target, following this pattern:
4946
5047``` bash
51- msbuild build.proj -t:< build_target> [optional_parameters]
48+ dotnet build build.proj -t:< build_target> [optional_parameters]
5249```
5350
5451The following build targets can be used to build the following projects. All targets will implicitly build any other
@@ -87,28 +84,28 @@ placed in `artifacts/Microsoft.Data.SqlClient.ref/Project-<configuration>/<tfm>`
8784
8885Build all projects:
8986``` bash
90- msbuild build.proj -t:Build
87+ dotnet build build.proj -t:Build
9188```
9289
9390Build Microsoft.Data.SqlClient in Release configuration:
9491``` bash
95- msbuild build.proj -t:BuildSqlClient -p:Configuration=Release
92+ dotnet build build.proj -t:BuildSqlClient -p:Configuration=Release
9693```
9794
9895Build v1.2.3 of Microsoft.Data.SqlClient.Extensions.Abstractions:
9996``` bash
100- msbuild build.proj -t:BuildAbstractions -p:PackageVersion=1.2.3
97+ dotnet build build.proj -t:BuildAbstractions -p:PackageVersion=1.2.3
10198```
10299
103100### Testing Projects
104101
105102This section provides a summary and brief example of how to execute tests for projects in this repository. ** For more
106103information about test procedures, including config file setup, see [ TESTGUIDE.md] ( TESTGUIDE.md ) .**
107104
108- From the root of your repository, run ` msbuild ` against ` build.proj ` with a test target, following this pattern:
105+ From the root of your repository, run ` dotnet build ` against ` build.proj ` with a test target, following this pattern:
109106
110107``` bash
111- msbuild build.proj -t:< test_target> [optional_parameters]
108+ dotnet build build.proj -t:< test_target> [optional_parameters]
112109```
113110
114111| ` <test_target> ` | Description |
@@ -140,37 +137,37 @@ A selection of parameters for test targets in `build.proj` relevant to common de
140137Run Microsoft.Data.SqlClient unit tests:
141138
142139``` bash
143- msbuild build.proj -t:TestSqlClientUnit
140+ dotnet build build.proj -t:TestSqlClientUnit
144141```
145142
146143Run Microsoft.Data.SqlClient manual test set 2:
147144``` bash
148- msbuild build.proj -t:TestSqlClientManual -p:TestSet=2
145+ dotnet build build.proj -t:TestSqlClientManual -p:TestSet=2
149146```
150147
151148Run Microsoft.Data.SqlClient functional tests against x86 dotnet:
152149``` bash
153- msbuild build.proj -t:TestSqlClientFunctional -p:DotnetPath=' C:\path\to\dotnet\x86\'
150+ dotnet build build.proj -t:TestSqlClientFunctional -p:DotnetPath=' C:\path\to\dotnet\x86\'
154151```
155152
156153Run all Microsoft.Data.SqlClient.Extensions.Azure unit tests, including interactive, but excluding failing tests:
157154``` bash
158- msbuild build.proj -t:TestAzure -p:TestFilters=category! =failing
155+ dotnet build build.proj -t:TestAzure -p:TestFilters=category! =failing
159156```
160157
161158Run Microsoft.Data.SqlClient functional tests against net8.0 runtime:
162159``` bash
163- msbuild build.proj -t:TestSqlClientFunctional -p:TestFramework=net8.0
160+ dotnet build build.proj -t:TestSqlClientFunctional -p:TestFramework=net8.0
164161```
165162
166163### Packaging Projects
167164
168165Just like bulding and testing the various projects in this repository, packaging the projects into NuGet packages is
169- also handle by ` build.proj ` . From the root of your repository, run ` msbuild ` against ` build.proj ` with a test target,
166+ also handle by ` build.proj ` . From the root of your repository, run ` dotnet build ` against ` build.proj ` with a pack target,
170167following this pattern:
171168
172169``` bash
173- msbuild build.proj -t:< pack_target> [optional_parameters]
170+ dotnet build build.proj -t:< pack_target> [optional_parameters]
174171```
175172
176173| ` <build_target> ` | Desription |
@@ -191,30 +188,34 @@ A selection of parameters for pack targets in `build.proj` relevant to common de
191188| ` [optional_parameter] ` | Default Value | Allowed Values | Description |
192189| ------------------------------------| ---------------| -----------------------| ----------------------------------------------------------------------------------------------------------------------------------------------------------------|
193190| ` -p:Configuration= ` | ` Debug ` | ` Debug ` , ` Release ` | Build configuration. Only applies if project and dependencies are being built. |
194- | ` -p:NugetPath= ` | ` [blank] ` | eg. ` C:\my\nuget.exe ` | _ Only applies to ` PackSqlClient ` ._ Path to ` nuget.exe ` that to use. If not provided, defaults to ` nuget.exe ` in the PATH. |
195191| ` -p:PackBuild= ` | ` true ` | ` true ` , ` false ` | Whether or not to build the project before packing. If ` false ` , project must be built using the same parameters. |
196192| ` -p:PackageVersion<TargetProject> ` | ` [blank] ` | eg. ` 1.2.3-dev123 ` | Version to assign to the package. If ` PackBuild ` is ` true ` , the assembly and file versions will be derived from this version. See Versioning for more details. |
197193
194+ For ` PackSqlClient ` , these additional parameters are required because dependency versions are injected into the SqlClient nuspec during pack:
195+
196+ - ` -p:PackageVersionAbstractions=<version> `
197+ - ` -p:PackageVersionLogging=<version> `
198+
198199#### Examples
199200
200201Package Microsoft.Data.SqlClient.Internal.Logging into a NuGet package:
201202``` bash
202- msbuild build.proj -t:PackLogging
203+ dotnet build build.proj -t:PackLogging
203204```
204205
205- Package Microsoft.Data.SqlClient if ` nuget.exe ` is not in the ` $PATH ` environment variable :
206+ Package Microsoft.Data.SqlClient:
206207``` bash
207- msbuild build.proj -t:PackSqlClient -p:NugetPath= " C:\my\nuget.exe "
208+ dotnet build build .proj -t:PackSqlClient -p:PackageVersionAbstractions= < version > -p:PackageVersionLogging= < version >
208209```
209210
210211Package version 1.2.3 of Microsoft.Data.SqlClient.Extensions.Abstractions:
211212``` bash
212- msbuild build.proj -t:PackAbstractions -p:PackageVersionAbstractions=1.2.3
213+ dotnet build build.proj -t:PackAbstractions -p:PackageVersionAbstractions=1.2.3
213214```
214215
215216Package version Microsoft.Data.SqlClient.Extensions.Azure without building it beforehand:
216217``` bash
217- msbuild build.proj -t:PackAzure -p:PackBuild=false
218+ dotnet build build.proj -t:PackAzure -p:PackBuild=false
218219```
219220
220221## Versioning
@@ -276,20 +277,20 @@ and Microsoft.Data.SqlClient.Internal.Logging v2.2.2.
276277
277278``` bash
278279# Build v2.2.2 of Logging and copy to packages
279- msbuild build.proj -t:PackLogging \
280+ dotnet build build.proj -t:PackLogging \
280281 -p:ReferenceType=Package \
281282 -p:PackageVersionLogging=2.2.2
282283cp artifacts/Microsoft.Data.SqlClient.Internal.Logging/Debug/* .* pkg packages/
283284
284285# Build v1.0.1 of Abstractions that depends on v2.2.2 of Logging
285- msbuild build.proj -t:PackAbstractions \
286+ dotnet build build.proj -t:PackAbstractions \
286287 -p:ReferenceType=Package \
287288 -p:PackageVersionAbstractions=1.0.1 \
288289 -p:PackageVersionLogging=2.2.2 \
289290cp artifacts/Microsoft.Data.SqlClient.Extensions.Abstractions/Package-Debug/* .* pkg packages/
290291
291292# Build SqlClient
292- msbuild -t:PackSqlClient \
293+ dotnet build build.proj -t:PackSqlClient \
293294 -p:ReferenceType=Package \
294295 -p:PackageVersionSqlClient=7.1.1 \
295296 -p:PackageVersionAbstractions=1.0.1 \
@@ -299,7 +300,7 @@ cp artifacts/Microsoft.Data.SqlClient/Package-Debug/*.*pkg packages/
299300
300301Run Microsoft.Data.SqlClient functional tests against the versions build above:
301302``` bash
302- msbuild build.proj -t:TestSqlClientFunctional \
303+ dotnet build build.proj -t:TestSqlClientFunctional \
303304 -p:ReferenceType=Package \
304305 -p:PackageVersionSqlClient=7.1.1 \
305306 -p:PackageVersionAbstractions=1.0.1 \
0 commit comments