Centralize and fix assembly versioning - #1885
Conversation
Add src/Directory.Build.props to set AssemblyVersion and FileVersion
consistently across all library projects:
- AssemblyVersion is pinned to 4.0.0.0 (major only). Because OpenCvSharp
is a strong-named assembly, changing AssemblyVersion on every release
would break .NET Framework consumers that lack binding redirects.
- FileVersion is also pinned to 4.0.0.0. The date-based 4th component
used in NuGet package versions (e.g. 20260530) exceeds the 65535
per-component limit of the Windows FILEVERSION PE resource, so it
cannot be used directly.
- InformationalVersion is left to the .NET SDK default, which sets it
to the full $(Version) string including pre-release suffix and commit
SHA (e.g. "4.13.0.20260530-beta+<sha>"). This is the human-readable
version visible in file properties ("Product version") and most tooling,
and is automatically correct whenever `dotnet pack -p:Version=...` is used.
Remove the now-redundant hardcoded AssemblyVersion/FileVersion entries
from OpenCvSharp.csproj, OpenCvSharp.Extensions.csproj, and
OpenCvSharp.WpfExtensions.csproj.
OpenCvSharp.Analyzers.csproj is intentionally unchanged; it already pins
to 1.0.0.0 at the project level with an explanatory comment.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis PR consolidates assembly version metadata management across the OpenCVSharp repository. A new ChangesAssembly Version Metadata Centralization
🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/issue-backlog.md`:
- Around line 26-29: Update the documentation sentence that says "automate
FileVersion and InformationalVersion from $(Version) in the release pipeline" to
state that FileVersion is intentionally pinned to 4.0.0.0 in
Directory.Build.props (due to Windows PE/FILEVERSION 65535-per-component limits
and the project comment in Directory.Build.props), while InformationalVersion
remains automated from $(Version) by the SDK; keep the recommended approach to
pin AssemblyVersion to the major (e.g., 4.0.0.0) and automate only
InformationalVersion in CI.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7547e1e7-41f0-47ea-8900-7950bef99e08
📒 Files selected for processing (5)
docs/issue-backlog.mdsrc/Directory.Build.propssrc/OpenCvSharp.Extensions/OpenCvSharp.Extensions.csprojsrc/OpenCvSharp.WpfExtensions/OpenCvSharp.WpfExtensions.csprojsrc/OpenCvSharp/OpenCvSharp.csproj
💤 Files with no reviewable changes (3)
- src/OpenCvSharp/OpenCvSharp.csproj
- src/OpenCvSharp.WpfExtensions/OpenCvSharp.WpfExtensions.csproj
- src/OpenCvSharp.Extensions/OpenCvSharp.Extensions.csproj
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Fixes #1704
Problem
AssemblyVersionandFileVersionwere hardcoded to4.13.0.0in each library project individually, and were not updated automatically at release time. Simply syncing them to the NuGet package version is not safe either: the date-based 4th component (e.g.20260530) exceeds the 65535 per-component limit of the Windows FILEVERSION PE resource, and bumpingAssemblyVersionon every release is a breaking change for .NET Framework consumers of a strong-named assembly (binding redirects would be required).Changes
Add
src/Directory.Build.propsto define assembly versioning policy in one place:AssemblyVersion→4.0.0.0(major-pinned). Strong-named assemblies should keepAssemblyVersionstable across minor/patch releases. .NET Framework consumers bind to this value; changing it forcesapp.configbinding redirects.FileVersion→4.0.0.0(pinned). The date-based 4th component (e.g.20260530) exceeds 65535, the Windows FILEVERSION resource limit, so it cannot be used directly.InformationalVersion— not set here; the .NET SDK automatically populates it with the full$(Version)string including the pre-release suffix and commit SHA (e.g.4.13.0.20260530-beta+<sha>). This is the human-readable version visible in Windows file properties ("Product version") and is automatically correct wheneverdotnet pack -p:Version=...is used in CI.Remove the now-redundant hardcoded
AssemblyVersion/FileVersionentries fromOpenCvSharp.csproj,OpenCvSharp.Extensions.csproj, andOpenCvSharp.WpfExtensions.csproj.OpenCvSharp.Analyzers.csprojis intentionally left unchanged; it already pins to1.0.0.0at the project level with an explanatory comment.Summary by CodeRabbit