Skip to content

Commit 78697c0

Browse files
committed
Try setting $(AutoGenerateAssemblyVersion) to fix up project template tests
1 parent f29ee6a commit 78697c0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
<IsAnalyzersProject Condition="$(MSBuildProjectName.EndsWith('.Analyzers'))">true</IsAnalyzersProject>
2323
<IsShipping Condition="'$(IsSampleProject)' == 'true' or '$(IsTestAssetProject)' == 'true' or '$(IsBenchmarkProject)' == 'true' or '$(IsUnitTestProject)' == 'true'">false</IsShipping>
2424

25+
<!--
26+
Use "real" assembly and file versions for all C# projects. This avoids inconsistent versions presented to compiler
27+
while build test template projects.
28+
-->
29+
<AutoGenerateAssemblyVersion Condition=" '$(Language)' == 'C#' ">true</AutoGenerateAssemblyVersion>
30+
2531
<!--
2632
Following logic mimics core-setup approach as well as
2733
https://github.com/dotnet/arcade/blob/694d59f090b743f894779d04a7ffe11cbaf352e7/src/Microsoft.DotNet.Arcade.Sdk/tools/Publish.proj#L30-L31

Directory.Build.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118

119119
<PropertyGroup Condition="'$(Language)' == 'C#' AND '$(IsReferenceAssemblyProject)' == 'true'">
120120
<!-- Reference assemblies should always use Major.Minor.0.0 for assembly versions even during servicing. Only the package version should be updated. -->
121+
<AutoGenerateAssemblyVersion>false</AutoGenerateAssemblyVersion>
121122
<AssemblyVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).0.0</AssemblyVersion>
122123
</PropertyGroup>
123124

0 commit comments

Comments
 (0)