Skip to content

Commit 7a896ef

Browse files
authored
Use dotnet CLI exclusively (no MSBuild) (#4168)
1 parent 6de7d3c commit 7a896ef

20 files changed

Lines changed: 266 additions & 229 deletions

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This project includes several key products and libraries that facilitate SQL Ser
3434
## 🛠️ Key Features
3535
- **Connectivity to SQL Server**: Provides robust and secure connections to SQL Server databases, using various authentication methods, such as Windows Authentication, SQL Server Authentication, and Entra ID authentication, e.g. `ActiveDirectoryIntegrated`, `ActiveDirectoryPassword`, `ActiveDirectoryServicePrincipal`,`ActiveDirectoryInteractive`, `ActiveDirectoryDefault`, and `ActiveDirectoryManagedIdentity`.
3636
- **Connection Resiliency**: Implements connection resiliency features to handle transient faults and network issues, ensuring reliable database connectivity.
37-
- **TLS Encryption**: Supports secure connections using TLS protocols to encrypt data in transit. Supports TLS 1.2 and higher, ensuring secure communication with SQL Server. Supported encryption modes are:
37+
- **TLS Encryption**: Supports secure connections using TLS protocols to encrypt data in transit. Supports TLS 1.2 and higher, ensuring secure communication with SQL Server. Supported encryption modes are:
3838
- **Optional**: Encryption is used if available, but not required.
3939
- **Mandatory**: Encryption is mandatory for the connection.
4040
- **Strict**: Enforces strict TLS requirements, ensuring only secure connections are established.
@@ -123,7 +123,7 @@ When a new issue is created, follow these steps:
123123
- Ensure the PR passes all CI checks before merging.
124124

125125
### ✅ Closing Issues
126-
- Add a comment summarizing the fix and referencing the PR
126+
- Add a comment summarizing the fix and referencing the PR
127127

128128
### ⚙️ Automating Workflows
129129
- Auto-label PRs based on folder paths (e.g., changes in `src/Microsoft.Data.SqlClient/src/``Area\SqlClient`, changes in `tests/``Area\Testing`) and whether they add new public APIs or introduce a breaking change.

.github/instructions/ado-pipelines.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Key parameters:
4949
- `runAlwaysEncryptedTests` — include AE test set; default `true`
5050
- `runLegacySqlTests` — include SQL Server 2016/2017 manual-test legs; default `true`
5151
- `debug` — enable debug output; default `false`
52-
- `dotnetVerbosity`MSBuild verbosity; default `normal`
52+
- `dotnetVerbosity`build verbosity; default `normal`
5353

5454
## Build Stage Order
5555

.github/instructions/architecture.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The `netcore/` and `netfx/` directories are legacy artifacts from the old dual-p
4949
- `netcore/ref/` and `netfx/ref/`**STILL ACTIVE**. Reference assemblies remain in these directories and define the public API surface for each target framework.
5050

5151
### OS Targeting with `TargetOs`
52-
The unified project uses a `TargetOs` MSBuild property to handle OS-specific compilation:
52+
The unified project uses a `TargetOs` build property to handle OS-specific compilation:
5353

5454
```xml
5555
<!-- Automatic OS detection -->

.github/instructions/testing.instructions.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ The default test filter is defined in `build.proj` via `TestFilters`:
115115
```xml
116116
<TestFilters Condition="'$(TestFilters)' == ''">category!=failing&amp;category!=flaky&amp;category!=interactive</TestFilters>
117117
```
118-
This can be overridden via MSBuild property: `msbuild build.proj -t:TestSqlClientUnit -p:TestFilters="your_filter"`.
118+
This can be overridden via build property: `dotnet build build.proj -t:TestSqlClientUnit -p:TestFilters="your_filter"`.
119119

120120
### Test Attributes
121121
```csharp
@@ -139,19 +139,19 @@ public void TestIntermittentlyFails() { ... }
139139

140140
## Running Tests
141141

142-
### Using MSBuild (Recommended)
142+
### Using `build.proj` targets (Recommended)
143143
```bash
144144
# Build and run all unit tests
145-
msbuild build.proj -t:TestSqlClientUnit
145+
dotnet build build.proj -t:TestSqlClientUnit
146146

147147
# Run functional tests only
148-
msbuild build.proj -t:TestSqlClientFunctional
148+
dotnet build build.proj -t:TestSqlClientFunctional
149149

150150
# Run manual tests for specific framework
151-
msbuild build.proj -t:TestSqlClientManual -p:TestFramework=net8.0
151+
dotnet build build.proj -t:TestSqlClientManual -p:TestFramework=net8.0
152152

153153
# Run specific test set
154-
msbuild build.proj -t:TestSqlClientManual -p:TestSet=1
154+
dotnet build build.proj -t:TestSqlClientManual -p:TestSet=1
155155
```
156156

157157
### Using dotnet CLI
@@ -357,7 +357,7 @@ cmd.CommandType = CommandType.StoredProcedure;
357357

358358
### Running with Coverage
359359
```bash
360-
msbuild build.proj -t:TestSqlClientUnit -p:TestCodeCoverage=true
360+
dotnet build build.proj -t:TestSqlClientUnit -p:TestCodeCoverage=true
361361
```
362362

363363
### Coverage Targets
@@ -367,16 +367,11 @@ msbuild build.proj -t:TestSqlClientUnit -p:TestCodeCoverage=true
367367

368368
## Debugging Tests
369369

370-
### Visual Studio
370+
### IDE
371371
1. Set breakpoints in test code
372-
2. Right-click test → Debug Test
372+
2. Right-click test → Debug Test (or use CodeLens "Debug Test" link)
373373
3. Use Test Explorer for navigation
374374

375-
### VS Code
376-
1. Configure C# extension
377-
2. Use CodeLens "Debug Test" link
378-
3. Attach to test process
379-
380375
### Command Line
381376
```bash
382377
# Enable verbose output

.github/plans/apicompat-ref-assembly-validation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The comparison uses `Microsoft.DotNet.ApiCompat.Tool` in **strict mode**, which
99
## Usage
1010

1111
```
12-
dotnet msbuild build.proj /t:CompareRefAssemblies /p:BaselinePackageVersion=6.1.4
12+
dotnet build build.proj /t:CompareMdsRefAssemblies /p:BaselinePackageVersion=6.1.4
1313
```
1414

1515
- `BaselinePackageVersion` is **required** (no default). The user must specify which published package to compare against.
@@ -22,7 +22,7 @@ dotnet msbuild build.proj /t:CompareRefAssemblies /p:BaselinePackageVersion=6.1.
2222

2323
Add an entry for version `9.0.200` alongside the existing `dotnet-coverage` entry. This enables `dotnet apicompat` after `dotnet tool restore`.
2424

25-
### 2. Create `tools/targets/CompareRefAssemblies.targets`
25+
### 2. Create `tools/targets/CompareMdsRefAssemblies.targets`
2626

2727
A single new file containing all properties, items, and targets (steps 3–11 below). Follows the naming convention of existing files like `GenerateMdsPackage.targets`.
2828

@@ -85,7 +85,7 @@ Runs `<Exec Command="dotnet tool restore" WorkingDirectory="$(RepoRoot)" />`.
8585
- Preceded by `<Message Importance="high">` labelling each comparison
8686
- Uses item metadata to map `net462` to `$(LegacyNetFxRefDir)` and others to `$(LegacyNetCoreRefDir)`
8787

88-
### 11. `CompareRefAssemblies` target (public entry point)
88+
### 11. `CompareMdsRefAssemblies` target (public entry point)
8989

9090
- Declared with `DependsOnTargets="_RunRefApiCompat"`
9191
- Emits a final `<Message>` summarizing completion
@@ -95,12 +95,12 @@ Runs `<Exec Command="dotnet tool restore" WorkingDirectory="$(RepoRoot)" />`.
9595
Add one line after the existing `.targets` imports (after line 7):
9696

9797
```xml
98-
<Import Project="$(ToolsDir)targets\CompareRefAssemblies.targets" />
98+
<Import Project="$(ToolsDir)targets\CompareMdsRefAssemblies.targets" />
9999
```
100100

101101
## Design Decisions
102102

103-
- **Single new file** at `tools/targets/CompareRefAssemblies.targets` — only one `<Import>` line added to `build.proj`.
103+
- **Single new file** at `tools/targets/CompareMdsRefAssemblies.targets` — only one `<Import>` line added to `build.proj`.
104104
- **Internal targets prefixed with `_`** to signal they're not intended to be called directly.
105105
- **Strict mode** ensures API additions are also flagged — important for detecting accidental public surface changes during file reorganization.
106106
- **`ContinueOnError="ErrorAndContinue"`** on each apicompat `Exec` so all 8 comparisons run and all differences are reported together.
@@ -111,7 +111,7 @@ Add one line after the existing `.targets` imports (after line 7):
111111
## Verification
112112

113113
```
114-
dotnet msbuild build.proj /t:CompareRefAssemblies /p:BaselinePackageVersion=6.1.4
114+
dotnet build build.proj /t:CompareMdsRefAssemblies /p:BaselinePackageVersion=6.1.4
115115
```
116116

117117
- Downloads 6.1.4 nupkg, builds both ref project variants, runs 8 comparisons (4 TFMs × 2 variants).

0 commit comments

Comments
 (0)