File tree 2 files changed +3
-3
lines changed
src/libraries/Microsoft.Extensions.HostFactoryResolver
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -163,9 +163,9 @@ static bool IsApplicationNameArg(string arg)
163
163
=> arg . Equals ( "--applicationName" , StringComparison . OrdinalIgnoreCase ) ||
164
164
arg . Equals ( "/applicationName" , StringComparison . OrdinalIgnoreCase ) ;
165
165
166
- args = args . Any ( arg => IsApplicationNameArg ( arg ) ) || assembly . FullName is null
166
+ args = args . Any ( arg => IsApplicationNameArg ( arg ) ) || assembly ? . GetName ( ) . Name is null
167
167
? args
168
- : args . Concat ( new [ ] { "--applicationName" , assembly . FullName } ) . ToArray ( ) ;
168
+ : args . Concat ( new [ ] { "--applicationName" , assembly . GetName ( ) . Name } ) . ToArray ( ) ;
169
169
170
170
var host = hostFactory ( args ) ;
171
171
return GetServiceProvider ( host ) ;
Original file line number Diff line number Diff line change @@ -274,7 +274,7 @@ public void ApplicationNameSetFromArgument()
274
274
IServiceProvider ? serviceProvider = factory ( Array . Empty < string > ( ) ) ;
275
275
276
276
var configuration = ( IConfiguration ) serviceProvider . GetService ( typeof ( IConfiguration ) ) ;
277
- Assert . Contains ( "ApplicationNameSetFromArgument" , configuration [ "applicationName" ] ) ;
277
+ Assert . Equal ( "ApplicationNameSetFromArgument" , configuration [ "applicationName" ] ) ;
278
278
}
279
279
280
280
[ ConditionalFact ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsThreadingSupported ) ) ]
You can’t perform that action at this time.
0 commit comments