Repository navigation
Closed
Labels
Milestone
Description
The PackageVersion property is currently specified four times instead of once centrally. We should consolidate that before we ship NET6 to ease servicing (especially as NET6 will be an LTS release).
This also involves consolidating the installer GetProductVersion logic with the rest of the repo:
runtime/src/installer/Directory.Build.targets
Lines 25 to 138 in 372248b
| <!-- | |
| Arcade SDK versioning is defined by static properties in a targets file: work around this by | |
| moving properties based on versioning into a target. | |
| --> | |
| <Target Name="GetProductVersions"> | |
| <PropertyGroup> | |
| <IncludePreReleaseLabelInPackageVersion Condition="'$(DotNetFinalVersionKind)' != 'release'">true</IncludePreReleaseLabelInPackageVersion> | |
| <IncludePreReleaseLabelInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludePreReleaseLabelInPackageVersion> | |
| <IncludePreReleaseLabelInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludePreReleaseLabelInPackageVersion> | |
| <IncludeBuildNumberInPackageVersion Condition="'$(StabilizePackageVersion)' != 'true'">true</IncludeBuildNumberInPackageVersion> | |
| <IncludeBuildNumberInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludeBuildNumberInPackageVersion> | |
| <IncludeBuildNumberInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludeBuildNumberInPackageVersion> | |
| <ProductVersionSuffix Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">-$(VersionSuffix)</ProductVersionSuffix> | |
| <ProductBandVersion Condition="'$(ProductBandVersion)' == ''">$(MajorVersion).$(MinorVersion)</ProductBandVersion> | |
| <ProductionVersion Condition="'$(ProductionVersion)' == ''">$(ProductBandVersion).$(PatchVersion)</ProductionVersion> | |
| <ProductVersion>$(ProductionVersion)$(ProductVersionSuffix)</ProductVersion> | |
| <SharedFrameworkNugetVersion>$(ProductVersion)</SharedFrameworkNugetVersion> | |
| <RuntimeDepsRpmVersion Condition="'$(RuntimeDepsRpmVersion)'==''">$(ProductVersion)</RuntimeDepsRpmVersion> | |
| <RuntimeDepsDebVersion Condition="'$(RuntimeDepsDebVersion)'==''">$(ProductVersion)</RuntimeDepsDebVersion> | |
| <NuGetVersion>$(SharedFrameworkNugetVersion)</NuGetVersion> | |
| <!-- | |
| By default, we are always building the nuget packages for HostPolicy, HostFXR and | |
| Dotnet/AppHost. Thus, the "UseShipped*" properties (below) are always set to false. | |
| However, there are scenarios when some of these components will not change (e.g. during | |
| servicing, we may only change HostPolicy but not HostFXR and Dotnet/AppHost). In such cases, | |
| set the appropriate "UseShipped*" property below to true and the corresponding "*Version" | |
| property to the desired version so that we use the last shipped version of the package. | |
| --> | |
| <!-- The host/apphost package versions are only updated whenever there is a change in the components --> | |
| <UseShippedHostPackage>false</UseShippedHostPackage> | |
| <HostVersion Condition="'$(UseShippedHostPackage)' != 'true'">$(ProductVersion)</HostVersion> | |
| <HostVersion Condition="'$(UseShippedHostPackage)' == 'true'">2.0.0</HostVersion> | |
| <!-- The AppHostVersion is used for all hosts that aren't dotnet.exe --> | |
| <UseShippedAppHostPackage>false</UseShippedAppHostPackage> | |
| <AppHostVersion Condition="'$(UseShippedAppHostPackage)' != 'true'">$(ProductVersion)</AppHostVersion> | |
| <AppHostVersion Condition="'$(UseShippedAppHostPackage)' == 'true'">2.0.0</AppHostVersion> | |
| <!-- | |
| The FXR Resolver package version is only updated whenever there is a change in it. | |
| If there is ever a need to use a shipped version of the package, then set the property | |
| below to true. | |
| --> | |
| <UseShippedHostResolverPackage>false</UseShippedHostResolverPackage> | |
| <HostResolverVersion Condition="'$(UseShippedHostResolverPackage)' != 'true'">$(ProductVersion)</HostResolverVersion> | |
| <HostResolverVersion Condition="'$(UseShippedHostResolverPackage)' == 'true'">2.0.0</HostResolverVersion> | |
| <!-- | |
| Host Policy package version is only updated whenever there is a change in it. | |
| If there is ever a need to use a shipped version of the package, then set the property | |
| below to true. | |
| --> | |
| <UseShippedHostPolicyPackage>false</UseShippedHostPolicyPackage> | |
| <HostPolicyVersion Condition="'$(UseShippedHostPolicyPackage)' != 'true'">$(ProductVersion)</HostPolicyVersion> | |
| <HostPolicyVersion Condition="'$(UseShippedHostPolicyPackage)' == 'true'">2.0.0</HostPolicyVersion> | |
| <InstallersRelativePath>Runtime/$(SharedFrameworkNugetVersion)/</InstallersRelativePath> | |
| </PropertyGroup> | |
| <PropertyGroup> | |
| <HostPackageVersion>$(HostVersion)</HostPackageVersion> | |
| <HostPackageRelease>1</HostPackageRelease> | |
| <HostResolverPackageVersion>$(HostResolverVersion)</HostResolverPackageVersion> | |
| <HostResolverPackageRelease>1</HostResolverPackageRelease> | |
| <RuntimePackageVersion>$(SharedFrameworkNugetVersion)</RuntimePackageVersion> | |
| <RuntimePackageRelease>1</RuntimePackageRelease> | |
| <RuntimeDepsDebPackageVersion>$(RuntimeDepsDebVersion)</RuntimeDepsDebPackageVersion> | |
| <RuntimeDepsDebPackageRelease>1</RuntimeDepsDebPackageRelease> | |
| <RuntimeDepsRpmPackageVersion>$(RuntimeDepsRpmVersion)</RuntimeDepsRpmPackageVersion> | |
| <RuntimeDepsRpmPackageRelease>1</RuntimeDepsRpmPackageRelease> | |
| </PropertyGroup> | |
| <PropertyGroup Condition="'$(InstallerExtension)' == '.deb'"> | |
| <HostPackageVersion Condition="'$(UseShippedHostPackage)' != 'true'">$(ProductionVersion)</HostPackageVersion> | |
| <HostPackageVersion Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true' AND '$(VersionSuffix)' !=''">$(ProductionVersion)~$(VersionSuffix)</HostPackageVersion> | |
| <HostResolverPackageVersion Condition="'$(UseShippedHostResolverPackage)' != 'true'">$(ProductionVersion)</HostResolverPackageVersion> | |
| <HostResolverPackageVersion Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true' AND '$(VersionSuffix)' !=''">$(ProductionVersion)~$(VersionSuffix)</HostResolverPackageVersion> | |
| <RuntimePackageVersion>$(ProductionVersion)</RuntimePackageVersion> | |
| <RuntimePackageVersion Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">$(ProductionVersion)~$(VersionSuffix)</RuntimePackageVersion> | |
| <RuntimeDepsDebPackageVersion>$(ProductionVersion)</RuntimeDepsDebPackageVersion> | |
| <RuntimeDepsDebPackageVersion Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true' AND '$(VersionSuffix)' !=''">$(ProductionVersion)~$(VersionSuffix)</RuntimeDepsDebPackageVersion> | |
| </PropertyGroup> | |
| <PropertyGroup Condition="'$(InstallerExtension)' == '.rpm'"> | |
| <HostPackageVersion Condition="'$(UseShippedHostPackage)' != 'true'">$(ProductionVersion)</HostPackageVersion> | |
| <HostPackageRelease Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">0.1.$(VersionSuffix)</HostPackageRelease> | |
| <HostPackageRelease>$([System.String]::Copy('$(HostPackageRelease)').Replace('-', '_'))</HostPackageRelease> | |
| <HostResolverPackageVersion Condition="'$(UseShippedHostResolverPackage)' != 'true'">$(ProductionVersion)</HostResolverPackageVersion> | |
| <HostResolverPackageRelease Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">0.1.$(VersionSuffix)</HostResolverPackageRelease> | |
| <HostResolverPackageRelease>$([System.String]::Copy('$(HostResolverPackageRelease)').Replace('-', '_'))</HostResolverPackageRelease> | |
| <RuntimePackageVersion>$(ProductionVersion)</RuntimePackageVersion> | |
| <RuntimePackageRelease Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">0.1.$(VersionSuffix)</RuntimePackageRelease> | |
| <RuntimePackageRelease>$([System.String]::Copy('$(RuntimePackageRelease)').Replace('-', '_'))</RuntimePackageRelease> | |
| <RuntimeDepsRpmPackageVersion>$(ProductionVersion)</RuntimeDepsRpmPackageVersion> | |
| <RuntimeDepsRpmPackageRelease Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">0.1.$(VersionSuffix)</RuntimeDepsRpmPackageRelease> | |
| <RuntimeDepsRpmPackageRelease>$([System.String]::Copy('$(RuntimeDepsRpmPackageRelease)').Replace('-', '_'))</RuntimeDepsRpmPackageRelease> | |
| </PropertyGroup> | |
| </Target> |
cc @dotnet/runtime-infrastructure
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
SamMonoRT commentedon Aug 10, 2022
Moving to 8.0.0
BekAllaev commentedon Nov 17, 2026
I believe this has been resolved.
GetProductVersionsand the installer-specific versioning logic were removed in#108990, and on current main
PackageVersionis no longer set anywhere in the repo. The only remaining occurrence iseng/packaging.targets:56, which just references the existing value($(PackageVersion)).Checked with git grep for
GetProductVersions,IncludePreReleaseLabelInPackageVersion, and for any place where thePackageVersionproperty is set (<PackageVersionin.props/.targets/.projfiles).@ViktorHofer, could this be closed?
ViktorHofer commentedon Nov 18, 2026
Sounds good