Fix .NET package version props generation#1387
Conversation
Generate the Copilot CLI version props before NuGet collects package files so the generated props file is included in the packed build assets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the .NET SDK project’s packaging pipeline so the generated GitHub.Copilot.SDK.props file (containing CopilotCliVersion) is included in the NuGet package build assets. This addresses the multi-targeting ordering issue where generating the props file before Pack was still too late for NuGet’s package file collection.
Changes:
- Move
_GenerateVersionPropsexecution earlier by running it before NuGet’s_GetPackageFilestarget. - Ensure the dynamically generated
build/GitHub.Copilot.SDK.propsis visible to NuGet when it enumerates files to include in the.nupkg.
Show a summary per file
| File | Description |
|---|---|
dotnet/src/GitHub.Copilot.SDK.csproj |
Adjusts target ordering so the generated .props file is included in the packed NuGet build assets. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
Cross-SDK Consistency Review ✅This PR makes a .NET-specific MSBuild build infrastructure fix — changing the This change has no API surface impact and is specific to .NET's MSBuild/NuGet packaging pipeline. There are no equivalent concepts in the Node.js, Python, or Go SDKs that would need corresponding changes. No cross-SDK consistency issues found.
|
The .NET package should include
GitHub.Copilot.SDK.propsso consumers getCopilotCliVersionfrom the NuGet build assets. After the multi-targeting change,_GenerateVersionPropsran beforePack, which is too late for NuGet's_GetPackageFilescollection, causing the props file to be omitted.This changes the generation hook to run before
_GetPackageFilesso the generated props item is visible when NuGet builds the package.Validated by packing with an isolated NuGet cache and checking the
.nupkgcontainsbuild/GitHub.Copilot.SDK.propswith the expected version.