Skip to content

Commit

Permalink
Fixed the discrepancy between applicationName between normal app laun…
Browse files Browse the repository at this point in the history
…ch and HostFactoryResolver launch (#102152)
  • Loading branch information
GMPrakhar authored Jun 12, 2024
1 parent aa4ac3f commit f5efc59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ static bool IsApplicationNameArg(string arg)
=> arg.Equals("--applicationName", StringComparison.OrdinalIgnoreCase) ||
arg.Equals("/applicationName", StringComparison.OrdinalIgnoreCase);
args = args.Any(arg => IsApplicationNameArg(arg)) || assembly.FullName is null
args = args.Any(arg => IsApplicationNameArg(arg)) || assembly?.GetName().Name is null
? args
: args.Concat(new[] { "--applicationName", assembly.FullName }).ToArray();
: args.Concat(new[] { "--applicationName", assembly.GetName().Name }).ToArray();
var host = hostFactory(args);
return GetServiceProvider(host);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public void ApplicationNameSetFromArgument()
IServiceProvider? serviceProvider = factory(Array.Empty<string>());

var configuration = (IConfiguration)serviceProvider.GetService(typeof(IConfiguration));
Assert.Contains("ApplicationNameSetFromArgument", configuration["applicationName"]);
Assert.Equal("ApplicationNameSetFromArgument", configuration["applicationName"]);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
Expand Down

0 comments on commit f5efc59

Please sign in to comment.