Skip to content

fix: restore <AssemblyVersion>1.0.0.0</AssemblyVersion> (C4 post-mortem)#188

Merged
Chris-Wolfgang merged 2 commits into
vNextfrom
fix/restore-assemblyversion
Jun 1, 2026
Merged

fix: restore <AssemblyVersion>1.0.0.0</AssemblyVersion> (C4 post-mortem)#188
Chris-Wolfgang merged 2 commits into
vNextfrom
fix/restore-assemblyversion

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Restores <AssemblyVersion>1.0.0.0</AssemblyVersion> + adds <FileVersion>$(Version).0</FileVersion> to the src csproj.

Why

The original C4 fanout dropped <AssemblyVersion> on the rationale that the hardcoded 1.0.0 was "stale" relative to released package versions. But that staleness was the correct binding-stability behaviour for a library that ships a net462 TFM. With SDK-derived AssemblyVersion, every minor/patch release ships a different binding identity, so .NET Framework consumers need a binding redirect on every bump or they hit a runtime FileLoadException.

DateTime-Extensions v1.3.0 publicly shipped this regression. This repo has not yet released the regression (the C4 drop is on canonical-unprotected but hasn't reached main). Landing this fix neutralises the footgun before any merge to main.

Standard library pattern (NodaTime / Newtonsoft / AutoMapper)

Property Bumps on Example
AssemblyVersion MAJOR only 1.0.0.0
AssemblyFileVersion every release <Version>.0
Version (NuGet) every release <Version>

AssemblyVersion only changes on a deliberate breaking API change (i.e., 2.0.0.0).

Tracked in the per-repo-release-pilot skill as the corrected Phase 2 step 1.

…4 fix)

The C4 fanout dropped <AssemblyVersion> on the rationale that the hardcoded
1.0.0 was 'stale' relative to released package versions, but that staleness
was the correct binding-stability behaviour for a library shipping a net462
TFM. SDK-deriving AssemblyVersion from <Version> changes the binding identity
on every minor/patch bump, breaking .NET Framework consumers without binding
redirects.
Copilot AI review requested due to automatic review settings May 28, 2026 13:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores <AssemblyVersion>1.0.0.0</AssemblyVersion> to the main library csproj and adds <FileVersion>$(Version).0</FileVersion> so .NET Framework consumers don't require binding redirects on every minor/patch bump, while file/informational versions still track the actual release version.

Changes:

  • Re-add a pinned AssemblyVersion of 1.0.0.0 with an explanatory comment.
  • Add FileVersion derived from $(Version) to carry the actual release version into the assembly metadata.

Addresses Copilot review feedback on the fix/restore-assemblyversion PR:
- Reword comment so it does not imply AssemblyVersion tracks NuGet major
  (it is a fixed binding-stability baseline, not derived from Version).
- Use regex-strip property function for FileVersion so prerelease
  <Version> values (e.g., 0.1.0-alpha) still produce a 4-part numeric
  AssemblyFileVersion (otherwise FileVersion fails the build).
- Remove pre-existing literal <FileVersion>1.0.0</FileVersion> where
  present (ETL repos) since MSBuild last-write semantics would
  otherwise override the property-function value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants