@@ -364,23 +364,27 @@ void CommandLoaderOnError(object sender, ErrorEventArgs e)
364
364
}
365
365
366
366
/// <summary>
367
- /// Setups with the specified configurations .
367
+ /// Gets the composition container .
368
368
/// </summary>
369
- /// <param name="rootConfig">The root configuration.</param>
370
- /// <param name="config">The server configuration.</param>
369
+ /// <param name="config">The configuration.</param>
371
370
/// <returns></returns>
372
- protected virtual bool Setup ( IRootConfig rootConfig , IServerConfig config )
371
+ protected virtual ExportProvider GetCompositionContainer ( IServerConfig config )
373
372
{
374
373
var catalog = new AggregateCatalog ( ) ;
375
374
catalog . Catalogs . Add ( new AssemblyCatalog ( typeof ( IAppServer ) . Assembly ) ) ;
376
375
catalog . Catalogs . Add ( new DirectoryCatalog ( AppDomain . CurrentDomain . BaseDirectory , "*.dll" ) ) ;
377
- var compositionContainer = new CompositionContainer ( catalog ) ;
378
-
379
- if ( ! Setup ( rootConfig , config , compositionContainer ) )
380
- return false ;
376
+ return new CompositionContainer ( catalog ) ;
377
+ }
381
378
382
- CompositionContainer = compositionContainer ;
383
- return true ;
379
+ /// <summary>
380
+ /// Setups with the specified configurations.
381
+ /// </summary>
382
+ /// <param name="rootConfig">The root configuration.</param>
383
+ /// <param name="config">The server configuration.</param>
384
+ /// <returns></returns>
385
+ protected virtual bool Setup ( IRootConfig rootConfig , IServerConfig config )
386
+ {
387
+ return Setup ( rootConfig , config , CompositionContainer ) ;
384
388
}
385
389
386
390
/// <summary>
@@ -429,6 +433,8 @@ private void SetupBasic(IRootConfig rootConfig, IServerConfig config, ISocketSer
429
433
m_ThreadPoolConfigured = true ;
430
434
}
431
435
436
+ CompositionContainer = GetCompositionContainer ( config ) ;
437
+
432
438
if ( socketServerFactory == null )
433
439
{
434
440
var socketServerFactoryType =
0 commit comments