File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -183,9 +183,13 @@ public IWebHost Build()
183
183
var logger = host . Services . GetRequiredService < ILogger < WebHost > > ( ) ;
184
184
185
185
// Warn about duplicate HostingStartupAssemblies
186
- foreach ( var assemblyName in _options . GetFinalHostingStartupAssemblies ( ) . GroupBy ( a => a , StringComparer . OrdinalIgnoreCase ) . Where ( g => g . Count ( ) > 1 ) )
186
+ var assemblyNames = new HashSet < string > ( StringComparer . OrdinalIgnoreCase ) ;
187
+ foreach ( var assemblyName in _options . GetFinalHostingStartupAssemblies ( ) )
187
188
{
188
- logger . LogWarning ( $ "The assembly { assemblyName } was specified multiple times. Hosting startup assemblies should only be specified once.") ;
189
+ if ( ! assemblyNames . Add ( assemblyName ) )
190
+ {
191
+ logger . LogWarning ( $ "The assembly { assemblyName } was specified multiple times. Hosting startup assemblies should only be specified once.") ;
192
+ }
189
193
}
190
194
191
195
return host ;
You can’t perform that action at this time.
0 commit comments