File tree 1 file changed +18
-3
lines changed
1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Generic ;
3
+ using System . ComponentModel . Composition . Hosting ;
4
+ using System . IO ;
3
5
using System . Linq ;
4
6
using System . Text ;
7
+ using SuperSocket . SocketBase . Command ;
5
8
using SuperSocket . SocketBase . Metadata ;
6
9
using SuperSocket . SocketBase . Pool ;
7
- using SuperSocket . SocketBase . Command ;
8
- using System . ComponentModel . Composition . Hosting ;
9
10
10
11
namespace SuperSocket . SocketBase
11
12
{
@@ -75,12 +76,26 @@ public static ExportProvider GetCurrentAppDomainExportProvider(this AppDomain ap
75
76
if ( exportProvider != null )
76
77
return exportProvider ;
77
78
79
+ var isolation = IsolationMode . None ;
80
+ var isolationValue = appDomain . GetData ( typeof ( IsolationMode ) . Name ) ;
81
+
82
+ if ( isolationValue != null )
83
+ isolation = ( IsolationMode ) isolationValue ;
84
+
78
85
var catalog = new AggregateCatalog ( ) ;
79
86
catalog . Catalogs . Add ( new AssemblyCatalog ( typeof ( IAppServer ) . Assembly ) ) ;
80
- catalog . Catalogs . Add ( new DirectoryCatalog ( AppDomain . CurrentDomain . BaseDirectory , "*.dll" ) ) ;
87
+
88
+ catalog . Catalogs . Add ( new DirectoryCatalog ( AppDomain . CurrentDomain . BaseDirectory , "*.*" ) ) ;
89
+
90
+ if ( isolation != IsolationMode . None )
91
+ {
92
+ catalog . Catalogs . Add ( new DirectoryCatalog ( Directory . GetParent ( AppDomain . CurrentDomain . BaseDirectory ) . Parent . FullName , "*.*" ) ) ;
93
+ }
94
+
81
95
exportProvider = new CompositionContainer ( catalog ) ;
82
96
83
97
appDomain . SetData ( CurrentAppDomainExportProviderKey , exportProvider ) ;
98
+
84
99
return exportProvider ;
85
100
}
86
101
}
You can’t perform that action at this time.
0 commit comments