Skip to content

Commit 41bc4ec

Browse files
committed
Fix logic for _GetPackageVersionInfo
1 parent 05f2430 commit 41bc4ec

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Directory.Build.targets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
<IsPackable Condition=" '$(IsPackageInThisPatch)' != 'true' ">false</IsPackable>
7171
</PropertyGroup>
7272

73+
<PropertyGroup>
74+
<PackageVersionForPackageVersionInfo>$(PackageVersion)</PackageVersionForPackageVersionInfo>
75+
</PropertyGroup>
76+
7377
<PropertyGroup Condition=" '$(IsPackageInThisPatch)' != 'true' AND '$(BaselinePackageVersion)' != '' AND '$(IsServicingBuild)' == 'true' ">
7478
<!-- This keeps assembly and package versions consistent across patches. If a package is not included in a patch, its version should stay at the baseline. -->
7579
<AssemblyVersion Condition="$(BaselinePackageVersion.Contains('-'))">$(BaselinePackageVersion.Substring(0, $(BaselinePackageVersion.IndexOf('-')))).0</AssemblyVersion>
@@ -83,6 +87,9 @@
8387
-->
8488
<Version Condition="'$(NoBuild)' == 'true' AND '$(DesignTimeBuild)' == 'true'">$(BaselinePackageVersion)</Version>
8589
<PackageVersion Condition="'$(NoBuild)' == 'true' AND '$(DesignTimeBuild)' == 'true'">$(BaselinePackageVersion)</PackageVersion>
90+
91+
<!-- For servicing builds, we want to resolve basline versions of project packages that aren't building, always -->
92+
<PackageVersionForPackageVersionInfo>$(BaselinePackageVersion)</PackageVersionForPackageVersionInfo>
8693
</PropertyGroup>
8794

8895
<PropertyGroup>

eng/targets/Packaging.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<ItemGroup>
1414
<_ProjectPathWithVersion Include="$(MSBuildProjectFullPath)">
1515
<PackageId>$(PackageId)</PackageId>
16-
<PackageVersion>$(PackageVersion)</PackageVersion>
16+
<PackageVersion>$(PackageVersionForPackageVersionInfo)</PackageVersion>
1717
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
1818
<VersionVariableName>$(PackageId.Replace('.',''))PackageVersion</VersionVariableName>
1919
</_ProjectPathWithVersion>

0 commit comments

Comments
 (0)