Repository navigation
Fix: a project reference is packed as a dependency at version 1.0.0 - #418
Merged
Merged
Conversation
Dependent projects run `_GetProjectVersion` on dependees and use whatever version it returns, defaulting to 1.0.0. `GetBuildVersion` wasn't called by `_GetProjectVersion`, so the version was never computed for dependent projects. Include `GetBuildVersion` in `GetPackageVersionDependsOn`, which `_GetProjectVersion` depends on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #418 +/- ##
=======================================
Coverage 87.50% 87.50%
=======================================
Files 330 330
Lines 9769 9769
Branches 1824 1824
=======================================
Hits 8548 8548
Misses 919 919
Partials 302 302 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rdeago
commented
Nov 2, 2026
rdeago
left a comment
Member
Author
There was a problem hiding this comment.
Review by Claude. Self-review.
👍 Approved.
No blocking findings.
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.
Checklist of related issues / discussions
Proposed changes
When a project is packed, the nuspec lists each project reference at version
1.0.0, whatever version Buildvana SDK computes for the referenced project.NuGet gets the version of a project reference by running
_GetProjectVersionon the referenced project. That target runs only$(GetPackageVersionDependsOn), then returns$(PackageVersion), or1.0.0when the property is empty.GetBuildVersionhooks the build, pack, and restore targets throughBeforeTargets, and none of them run in that call. SoPackageVersionstayed empty. The regression dates from a17ee83, which replaced Nerdbank.GitVersioning with the Versioning module.The fix adds
GetBuildVersiontoGetPackageVersionDependsOn, insrc/Buildvana.Sdk/Modules/Versioning/Module.Core.targets. TheBeforeTargetslist stays as it is, because each of its entries covers a path thatGetPackageVersionDependsOndoes not reach.VersioningModuleTests.GetProjectVersion_ReturnsTheComputedVersionruns_GetProjectVersionon a project in a temporary Git repository. The project imports the real targets of the module and of NuGet pack. The test checks the version that_GetProjectVersionreturns. Without the fix, the test gets1.0.0.The
GetBuildVersionsection ofdocs/sdk-modules/versioning.mdsays that the target also runs when a referencing project is packed.Additional changes
None.
Types of changes
This pull request introduces the following types of changes:
.gitattributes,.gitignore)Breaking changes
This pull request introduces breaking changes:
Checklist
🤖 Generated with Claude Code