chore: hold the package version in one place - #13
Merged
Merged
Conversation
The per-project <Version> fields were dead and misleading. CI publishes
with -p:Version=${GITHUB_REF_NAME#v}, so the git tag has always been the
real version and these values never reached NuGet — they only told anyone
reading the csproj, or packing locally, something untrue.
They had drifted accordingly. Worst case was app-foundation: six copies,
five reading 1.8.0 and MailService reading 1.9.0, against a published
2.1.0 — evidence that per-project versioning was once intended and died
quietly when CI started packing everything from one tag.
Moved to the shared Directory.Build.props, which every package here
already inherits, and removed the per-project copies. One line per repo
instead of one per project, seeded with the version actually published.
Behaviour is unchanged where it matters: -p:Version still overrides, so
CI packs exactly as before. A local pack now reports the released version
rather than a stale one.
This was referenced Sep 5, 2026
This was referenced Sep 12, 2026
This was referenced Sep 19, 2026
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 per-project
<Version>fields in this repo were dead and misleading.CI publishes with
-p:Version=${GITHUB_REF_NAME#v}, so the git tag hasalways been the real version. These values never reached NuGet — they only told
anyone reading the csproj, or packing locally, something untrue.
1.0.01.0.2The change
One
<Version>in the sharedDirectory.Build.props— which every packagehere already inherits for
Authors,RepositoryUrland the rest — and theper-project copies removed. Seeded with the version actually published.
Consolidated rather than just corrected, because correcting would drift again on
the next release. app-foundation is the proof of that: six copies, five reading
1.8.0 and MailService reading 1.9.0, against a published 2.1.0 — per-project
versioning was once intended and died quietly when CI started packing everything
from one tag. This makes that reality explicit instead of leaving six places to
forget.
Behaviour is unchanged where it matters
Verified by packing both ways rather than reasoning about it:
dotnet pack -p:Version=9.9.9…9.9.9.nupkg…1.0.2.nupkg(previously a stale number)-p:Versionstill wins, so nothing about publishing changes.Verification
dotnet build— 0 errors, 0 warningsdotnet csharpier check .cleanDirectory.Build.propsandsrc/*/*.csprojtouchedPart of a sweep across all seven packable repos, which were stale in five of
them.