Skip to content

Commit 044bda1

Browse files
committed
add preprocessor for HeadingInfo to show correct Heading for .NET Framework it's from AssemblyInfo, for .NET Standard file without extension.
1 parent 67f77e1 commit 044bda1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/CommandLine/Text/HeadingInfo.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,19 @@ public static HeadingInfo Default
5555
{
5656
get
5757
{
58-
var title = ReflectionHelper.GetAttribute<AssemblyTitleAttribute>()
58+
string title = ReflectionHelper.GetAssemblyName();
59+
#if NETSTANDARD1_5
60+
title = ReflectionHelper.GetAttribute<AssemblyTitleAttribute>()
5961
.MapValueOrDefault(
6062
titleAttribute => Path.GetFileNameWithoutExtension(titleAttribute.Title),
61-
ReflectionHelper.GetAssemblyName());
63+
title);
64+
#else
65+
title = ReflectionHelper.GetAttribute<AssemblyTitleAttribute>()
66+
.MapValueOrDefault(
67+
titleAttribute => titleAttribute.Title,
68+
title);
69+
#endif
70+
6271
var version = ReflectionHelper.GetAttribute<AssemblyInformationalVersionAttribute>()
6372
.MapValueOrDefault(
6473
versionAttribute => versionAttribute.InformationalVersion,

0 commit comments

Comments
 (0)