Skip to content

Commit d334db7

Browse files
committed
Fix Copilot follow-ups for dotnet pack property contracts
- Align PrepareSqlClientPackNuspec error guidance with direct dotnet pack properties and build.proj aliases - Update sqlclient-dotnet-pack.md replacement list to use $NuspecVersion$ token - Correct direct repro command to pass AbstractionsPackageVersion/LoggingPackageVersion and clarify entrypoint property translation
1 parent f555b39 commit d334db7

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@
9999
<Target Name="PrepareSqlClientPackNuspec"
100100
BeforeTargets="GenerateNuspec"
101101
Condition="'$(NuspecFile)' == '$(SqlClientPackNuspecTemplatePath)'">
102-
<Error Text="PrepareSqlClientPackNuspec requires AbstractionsPackageVersion. Specify -p:PackageVersionAbstractions=&lt;version&gt;."
102+
<Error Text="PrepareSqlClientPackNuspec requires AbstractionsPackageVersion. Specify -p:AbstractionsPackageVersion=&lt;version&gt; (or -p:PackageVersionAbstractions=&lt;version&gt; when invoking build.proj)."
103103
Condition="'$(AbstractionsPackageVersion)' == ''" />
104-
<Error Text="PrepareSqlClientPackNuspec requires LoggingPackageVersion. Specify -p:PackageVersionLogging=&lt;version&gt;."
104+
<Error Text="PrepareSqlClientPackNuspec requires LoggingPackageVersion. Specify -p:LoggingPackageVersion=&lt;version&gt; (or -p:PackageVersionLogging=&lt;version&gt; when invoking build.proj)."
105105
Condition="'$(LoggingPackageVersion)' == ''" />
106106
<Error Text="PrepareSqlClientPackNuspec requires NuspecVersion. Specify -p:NuspecVersion=&lt;version&gt;."
107107
Condition="'$(NuspecVersion)' == ''" />

src/Microsoft.Data.SqlClient/src/sqlclient-dotnet-pack.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ In this flow, SDK pack token substitution is reliable for general nuspec propert
3434
- Replacements applied:
3535
- `$AbstractionsPackageVersion$` -> `$(AbstractionsPackageVersion)`
3636
- `$LoggingPackageVersion$` -> `$(LoggingPackageVersion)`
37-
- `<version>1.0.0</version>` -> `<version>$(NuspecVersion)</version>`
37+
- `$NuspecVersion$` -> `$(NuspecVersion)`
3838

3939
This keeps layout parity with the existing nuspec while using `dotnet pack` end-to-end.
4040

@@ -49,9 +49,11 @@ dotnet pack src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj --n
4949
To reproduce this failure in the current branch and exercise the workaround, also pass the required MSBuild properties:
5050

5151
```bash
52-
dotnet pack src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj --no-build -p:Configuration=Debug -p:ReferenceType=Project -p:PackageVersionAbstractions=1.0.0-dev -p:PackageVersionLogging=1.0.0-dev -p:NuspecVersion=7.1.0-preview1-dev -p:PackageOutputPath=<repo>/artifacts/tmp -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
52+
dotnet pack src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj --no-build -p:Configuration=Debug -p:ReferenceType=Project -p:AbstractionsPackageVersion=1.0.0-dev -p:LoggingPackageVersion=1.0.0-dev -p:NuspecVersion=7.1.0-preview1-dev -p:PackageOutputPath=<repo>/artifacts/tmp -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
5353
```
5454

55+
Note: `PackageVersionAbstractions` and `PackageVersionLogging` are `build.proj` entrypoint properties and are translated to `AbstractionsPackageVersion` and `LoggingPackageVersion` for direct project pack.
56+
5557
The `PrepareSqlClientPackNuspec` target will materialize the tokens into an intermediate nuspec, bypassing the SDK's substitution bug.
5658

5759
Observed error (without workaround):

0 commit comments

Comments
 (0)