Repository navigation
chore: derive every version from a single <Version> - #461
Merged
Merged
Conversation
Define the version once in src/Directory.Build.props. The library now generates AssemblyVersion (major only, as it is strong-named), AssemblyFileVersion and AssemblyInformationalVersion from it instead of hard-coding them in AssemblyInfo.cs, which the /p:Version of a release never reached. The per-project versions go, AppVeyor no longer patches version numbers into the files, and a test checks that every assembly carries the solution version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lduchosal
had a problem deploying
to
github-pages
October 24, 2026 15:54 — with
GitHub Actions
Failure
Contributor
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
Coverage Report for CI Build 1053Coverage remained the same at 94.172%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
|
This branch had an error being deployed
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.



Summary
The version used to be written in five places that nothing kept in sync, and
AssemblyVersionhad been left at 3.2.0.0 for several 4.x releases. Worse, because the library usedGenerateAssemblyInfo=false, the/p:Version=<tag>thatrelease.ymlpasses never reachedAssemblyVersionandAssemblyFileVersion: the published DLL carried whatever was hard-coded inAssemblyInfo.cs.The version is now defined once, and everything else derives from it.
src/Directory.Build.props<Version>5.0.1</Version>, the single sourceSystem.Net.IPNetwork.csprojPackageVersionVersionProperties/AssemblyInfo.csAssemblyVersion/AssemblyFileVersionTestProject.csproj,ConsoleApplication.csprojVersionappveyor.ymlAssemblyInfoand.csprojwith{version}How the versions derive
For
Version=5.0.1, or the release tag passed with/p:Version:5.0.1AssemblyVersion5.0.0.0(major only: minor and patch releases don't force a recompile)5.0.1.0(shown by--version)AssemblyFileVersion5.0.1.05.0.1.0AssemblyInformationalVersion5.0.1+<commit>5.0.1+<commit>The library keeps its descriptive attributes (title, company, copyright, ...) in
AssemblyInfo.cs. Only the version attributes are generated now, and the matching generators are turned off to avoid duplicates.Guard
VersionConsistencyUnitTestcompares the version recorded in the test assembly at build time (AssemblyMetadata ExpectedVersion = $(Version)) with what the library and the console DLLs actually carry. Any future drift fails CI.versionize
Checked on a scratch repository:
versionizediscovers and bumps a<Version>inDirectory.Build.props("Discovered 1 versionable projects … Directory.Build.props, bumping version from 5.0.1 to 5.0.2").Tests
/p:Version=5.2.3-beta.1: the version tests pass, anddotnet packproducesIPNetwork2.5.2.3-beta.1.nupkg.🤖 Generated with Claude Code