Skip to content

IdentityModel file version revision differs due to DateTime.Now-based formula #5509

@mthalman

Description

@mthalman

The IdentityModel DLLs have a FileVersion revision that is computed from the current date/time, causing it to always differ between builds:

  • MSFT: FileVersion:8.0.1.50722
  • SB: FileVersion:8.0.0.64245

(Note: the 8.0.0 vs 8.0.1 base difference is #5508; this issue is about the 50722 vs 64245 revision.)

The IdentityModel repo's build/common.props computes the FileVersion revision using a DateTime.Now-based formula:

<FileVersion Condition="'$(WilsonVersion)' != '' and '$(IsCustomPreview)' != 'true'">
    $(WilsonVersion).$([System.DateTime]::Now.AddYears(-2019).Year)$([System.DateTime]::Now.ToString("MMdd"))</FileVersion>

The revision is {yearsSince2019}{MMdd}, so a build on July 22 of year 5 (2024) produces 50722, while a build on a different date produces a different value. This is inherently non-deterministic — even if Category 3's base version issue were fixed, the revision would still differ between the MSFT and SB builds.

Affected DLLs

  • Microsoft.IdentityModel.Abstractions.dll
  • Microsoft.IdentityModel.JsonWebTokens.dll
  • Microsoft.IdentityModel.Logging.dll
  • Microsoft.IdentityModel.Tokens.dll
  • System.IdentityModel.Tokens.Jwt.dll

Metadata

Metadata

Assignees

Labels

area-buildImprovements in source-build's own build process

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions