Skip to content

ApplicationInsights assembly and file version revision differs due to hours-since-baseline formula #5510

@mthalman

Description

@mthalman

Microsoft.ApplicationInsights.dll has AssemblyVersion and FileVersion revisions that differ between MSFT and SB builds:

  • MSFT: AssemblyVersion:2.23.0.29, FileVersion:2.23.0.00029
  • SB: AssemblyVersion:2.23.0.789, FileVersion:2.23.0.00789

The ApplicationInsights repo's _GlobalStaticVersion.props computes a BuildNumber from the hours elapsed since a baseline date (SemanticVersionDate), divided by 12:

<BuildNumberHours>$([MSBuild]::Divide(
    $([System.DateTime]::Now.Subtract(
        $([System.DateTime]::Parse($(SemanticVersionDate)))).TotalHours), 12))</BuildNumberHours>
<BuildNumber>$([System.Math]::Floor($(BuildNumberHours)).ToString('F0').PadLeft(5, '0'))</BuildNumber>

<AssemblyVersion>$(VersionPrefix).$(BuildNumber)</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>

This BuildNumber flows into both AssemblyVersion and FileVersion. Since source-build runs at a different time than the MSFT build, the revision always differs. The source-build project application-insights.proj passes /p:StableRelease=True but does not override AssemblyVersion or FileVersion.

Affected DLLs

  • Microsoft.ApplicationInsights.dll

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    Status

    11.0

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions