Skip to content

Commit 6bf07d3

Browse files
committed
Set app name to entry assembly if not specified otherwise
1 parent 2326c8e commit 6bf07d3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/CommandLineUtils/Internal/ReflectionAppBuilder.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ private void EnsureInitialized()
8282

8383
if (App.Name == null)
8484
{
85-
App.Name = type.Name;
85+
var assembly = Assembly.GetEntryAssembly() == null
86+
? typeInfo.Assembly
87+
: Assembly.GetEntryAssembly();
88+
App.Name = assembly.GetName().Name;
8689
}
8790

8891
if (parsingOptionsAttr?.ThrowOnUnexpectedArgument == false)

0 commit comments

Comments
 (0)