Skip to content

Commit 62a5b34

Browse files
authored
Fix IncludeBuildNumberInPackageVersion for official builds (dotnet#3181)
When doing an official build and setting a AzDO build variable, the variable turns into an environment variable. When MSBuild props/targets files declare a property, if they don't check if the property is already set, the MSBuild props file will override the environment variable. This causes the AzDO build variable to be ignored. Adding a check if the IncludeBuildNumberInPackageVersion property is already set before setting it in Directory.Build.props.
1 parent c7e12bc commit 62a5b34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<AssemblyFileVersion Condition="'$(AssemblyFileVersion)'==''">$(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)</AssemblyFileVersion>
6464

6565
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
66-
<IncludeBuildNumberInPackageVersion Condition="'$(StabilizePackageVersion)' != 'true'">true</IncludeBuildNumberInPackageVersion>
66+
<IncludeBuildNumberInPackageVersion Condition="'$(IncludeBuildNumberInPackageVersion)' == '' and '$(StabilizePackageVersion)' != 'true'">true</IncludeBuildNumberInPackageVersion>
6767

6868
<VersionSuffix></VersionSuffix>
6969
<VersionSuffix Condition="'$(StabilizePackageVersion)' != 'true'">$(PreReleaseLabel)</VersionSuffix>

0 commit comments

Comments
 (0)