Merge | Not Supported Binaries / Test Targets#3997
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes two main changes: (1) adds test targets to build2.proj with detailed parameter documentation for running MDS tests via MSBuild, and (2) creates a new dedicated project (notsupported/) to generate "Not Supported" assemblies from the common MDS ref project using GenAPI, replacing the previous approach that was embedded in the netcore/netfx projects. Additional changes include strong-name signing for ref binaries, updated output paths for ref assemblies, conditional exclusion of net462 from Unix builds, and GenAPI project updates to target a single framework (net9.0).
Changes:
- New
notsupported/Microsoft.Data.SqlClient.csprojproject and updatedNotSupported.targetsfor generating PlatformNotSupportedException assemblies via GenAPI - Expanded
build2.projwith test targets (TestMdsFunctional,TestMdsManual,TestMdsUnit), build targets (BuildMdsRef,BuildMdsNotSupported), and comprehensive parameter documentation - Conditional net462 exclusion on Unix, strong-name signing for ref binaries, and GenAPI project simplification to single net9.0 target
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| build2.proj | Major expansion: imports, test/build targets, detailed parameter docs |
| tools/targets/NotSupported.targets | Replaced old GenAPI variable setup with new paths/command, but Exec still uses old vars |
| src/Microsoft.Data.SqlClient/notsupported/Microsoft.Data.SqlClient.csproj | New project to generate Not Supported assemblies via GenAPI |
| src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj | Reordered TargetOs/TargetFrameworks, added signing, conditional net462 on Windows only |
| src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj | Added strong-name signing and custom output path under artifacts/ |
| tools/GenAPI/Microsoft.DotNet.GenAPI/Microsoft.DotNet.GenAPI.csproj | Simplified to single net9.0 target, removed custom OutputPath |
| tools/GenAPI/Microsoft.Cci.Extensions/Microsoft.Cci.Extensions.csproj | Removed custom OutputPath |
| src/Microsoft.Data.SqlClient.sln | Added notsupported, GenAPI, and Cci.Extensions projects (no build) |
| .gitignore | Added pattern to ignore generated notsupported .cs files |
src/Microsoft.Data.SqlClient/notsupported/Microsoft.Data.SqlClient.csproj
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/notsupported/Microsoft.Data.SqlClient.csproj
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/notsupported/Microsoft.Data.SqlClient.csproj
Outdated
Show resolved
Hide resolved
…e projects themselves
Ignore trx test results from git
Adding conditional net462 stuff to stress test Directory.Build.props Adding TestUtilities reference to Azure test
build2.proj
Outdated
| <Target Name="BuildMdsNotSupported"> | ||
| <PropertyGroup> | ||
| <DotNetCommand> | ||
| "$(DotNetPath)dotnet" build "$(GenApiPath)/Microsoft.DotNet.GenAPI.csproj" |
There was a problem hiding this comment.
Bug: $(GenApiPath) already ends with a trailing / (defined at line 155 as $(RepoRoot)tools/GenAPI/Microsoft.DotNet.GenAPI/), so this produces a double slash in the path: .../Microsoft.DotNet.GenAPI//Microsoft.DotNet.GenAPI.csproj.
Additionally, line 156 already defines $(GenApiProjectPath) as $(GenApiPath)Microsoft.DotNet.GenAPI.csproj for exactly this purpose, but it's not used here. Replace "$(GenApiPath)/Microsoft.DotNet.GenAPI.csproj" with "$(GenApiProjectPath)".
| "$(DotNetPath)dotnet" build "$(GenApiPath)/Microsoft.DotNet.GenAPI.csproj" | |
| "$(DotNetPath)dotnet" build "$(GenApiProjectPath)" |
src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj
Outdated
Show resolved
Hide resolved
Remove redundant strong naming from common MDS Fix typos as per copilot (why couldn't it find these the first time around??)
…life slightly easier
| PackageVersionLogging | ||
| Applies to: BuildMds, BuildMdsUnix, BuildMdsWindows | ||
| TestMdsFunctiona, TestMdsManual | ||
| Description: Specifies what version of the Microsoft.Data.SqlCLient.Logging to use |
There was a problem hiding this comment.
Spelling: "SqlCLient" should be "SqlClient" (lowercase 'l'), same as the occurrence at line 33.
| <!-- Strong name signing ============================================= --> | ||
| <!-- When a signing key is specified, we will perform strong name assembly signing. --> | ||
| <PropertyGroup Condition="'$(SigningKeyPath)' != ''"> | ||
| <SignAssembly>true</SignAssembly> | ||
| <AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile> | ||
| </PropertyGroup> | ||
|
|
There was a problem hiding this comment.
The strong name signing properties (SignAssembly, AssemblyOriginatorKeyFile) are already set by src/Directory.Build.props (lines 121-123), which this project inherits via MSBuild's automatic Directory.Build.props walk-up. This block is redundant. Consider removing it to keep the signing configuration centralized, or at minimum add a comment explaining why the duplication is intentional.
| <!-- Strong name signing ============================================= --> | |
| <!-- When a signing key is specified, we will perform strong name assembly signing. --> | |
| <PropertyGroup Condition="'$(SigningKeyPath)' != ''"> | |
| <SignAssembly>true</SignAssembly> | |
| <AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile> | |
| </PropertyGroup> |
| <!-- | ||
| PackageVersionLogging | ||
| Applies to: BuildMds, BuildMdsUnix, BuildMdsWindows | ||
| TestMdsFunctiona, TestMdsManual |
There was a problem hiding this comment.
Spelling: "TestMdsFunctiona" is missing the trailing "l" — should be "TestMdsFunctional".
| TestMdsFunctiona, TestMdsManual | |
| TestMdsFunctional, TestMdsManual |
| <Target Name="BuildMds" DependsOnTargets="BuildMdsUnix;BuildMdsWindows;BuildMdsRef;BuildMdsNotSupported" /> | ||
|
|
||
| <!-- | ||
| BuildMdsNotSupportd: Builds a version of the MDS assemblies that always throws |
There was a problem hiding this comment.
Spelling: "BuildMdsNotSupportd" in the comment is missing the trailing "e" — should be "BuildMdsNotSupported".
| BuildMdsNotSupportd: Builds a version of the MDS assemblies that always throws | |
| BuildMdsNotSupported: Builds a version of the MDS assemblies that always throws |
| <DotNetCommand> | ||
| "$(DotNetPath)dotnet" build "$(GenApiProjectPath)" | ||
| -p:Configuration=$(Configuration) | ||
| </DotNetCommand> | ||
| <!-- Convert more than one whitespace character into one space --> | ||
| <DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand> |
There was a problem hiding this comment.
Bug: $(DotNetPath) (capital N) on lines 215 and 232 is inconsistently cased compared to the build parameter $(DotnetPath) (lowercase n) defined on line 27. While MSBuild properties are case-insensitive so this won't cause a runtime failure, the naming within this same target is self-inconsistent: the property is initially set as DotNetCommand (lines 214, 231) but the regex replace overwrites a differently-cased DotnetCommand (lines 219, 237). Although MSBuild treats these as the same property, please use consistent casing throughout for readability — the rest of the file uses DotnetCommand and DotnetPath.
| PackageVersionAbstractions | ||
| Applies to: BuildMds, BuildMdsRef, BuildMdsUnix, BuildMdsWindows | ||
| TestMdsFunctional, TestMdsManual | ||
| Description: Specifies what version of the Microsoft.Data.SqlCLient.Abstractions to use |
There was a problem hiding this comment.
Spelling: "SqlCLient" should be "SqlClient" (lowercase 'l'). This appears in both the PackageVersionAbstractions and PackageVersionLogging parameter descriptions.
Description
This PR consists of two main changes:
Add test targets to build2.proj
Generate "Not Supported" assemblies from common MDS
Msc Changes
Issues
N/A
Testing
Running targets locally work as expected. Hopefully there are no major issues with the pipelines, since most of the changes don't affect existing pipelines.