Skip to content

Use DayOfYear for file version to preserve date info and avoid overflow#4044

Closed
Copilot wants to merge 2 commits intoFixBuildfrom
copilot/sub-pr-4043
Closed

Use DayOfYear for file version to preserve date info and avoid overflow#4044
Copilot wants to merge 2 commits intoFixBuildfrom
copilot/sub-pr-4043

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

The original patch fixed a 16-bit overflow (70105 > 65535) by changing ToString("MMdd") to ToString("dd"), but this removed month information from the FileVersion.

Changes

  • Replace ToString("dd") with DayOfYear property in the patch
  • Apply fix to both FileVersion conditions (not just one)

This preserves temporal information as day-of-year (1-366) while keeping values under the limit (max: 7366).

-<FileVersion>$(WilsonCurrentVersion).$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.ToString("dd"))</FileVersion>
+<FileVersion>$(WilsonCurrentVersion).$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.DayOfYear)</FileVersion>

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Changed ToString("dd") to DayOfYear in both FileVersion lines.
This preserves date information (day 1-366) while staying under
the 16-bit limit (max 7366 for year 2026 vs 65535 limit).

Co-authored-by: ViktorHofer <[email protected]>
@dotnet-policy-service dotnet-policy-service bot requested a review from a team January 5, 2026 10:22
Copilot AI changed the title [WIP] Address feedback for build fix from PR #4043 Use DayOfYear for file version to preserve date info and avoid overflow Jan 5, 2026
Copilot AI requested a review from ViktorHofer January 5, 2026 10:24
@ViktorHofer ViktorHofer closed this Jan 5, 2026
@ViktorHofer ViktorHofer deleted the copilot/sub-pr-4043 branch January 5, 2026 10:44
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