Fix .NET SDK package; ensure no auto update#392
Merged
SteveSandersonMS merged 2 commits intomainfrom Feb 6, 2026
Merged
Conversation
The _GenerateVersionProps target was running BeforeTargets=BeforeBuild, but dotnet pack evaluates ItemGroup wildcards before targets run. This meant the generated .props file wasn't being included in the package. Fixed by: 1. Adding Pack to BeforeTargets so the target runs before packing 2. Explicitly adding the props file to pack content inside the target 3. Changing the static ItemGroup to only include the .targets file
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical packaging issue where the generated GitHub.Copilot.SDK.props file was missing from published NuGet packages, causing consumer projects to fail with a "CopilotCliVersion not set" error. The props file contains the Copilot CLI version read from the Node.js package-lock.json at build time and must be included in the NuGet package for the SDK to function correctly in consuming projects.
Changes:
- Modified the
_GenerateVersionPropstarget to run before bothBeforeBuildandPackoperations - Added explicit inclusion of the generated props file to package content within the target after generation
- Replaced wildcard pattern
build\GitHub.Copilot.SDK.*with explicit inclusion of only the.targetsfile statically
Prevents the CLI from auto-updating itself, ensuring the version bundled with the SDK is the version that runs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The published NuGet package was missing GitHub.Copilot.SDK.props, causing consumers to get an error about CopilotCliVersion not being set.
Fixed by adding Pack to BeforeTargets and explicitly adding the props file to pack content inside the target after generation.