File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,13 @@ internal class AssemblyManager
17
17
{
18
18
// modified from event handlers below, potentially triggered from different .NET threads
19
19
// therefore this should be a ConcurrentDictionary
20
+ //
21
+ // WARNING: Dangerous if cross-app domain usage is ever supported
22
+ // Reusing the dictionary with assemblies accross multiple initializations is problematic.
23
+ // Loading happens from CurrentDomain (see line 53). And if the first call is from AppDomain that is later unloaded,
24
+ // than it can end up referring to assemblies that are already unloaded (default behavior after unload appDomain -
25
+ // unless LoaderOptimization.MultiDomain is used);
26
+ // So for multidomain support it is better to have the dict. recreated for each app-domain initialization
20
27
private static ConcurrentDictionary < string , ConcurrentDictionary < Assembly , string > > namespaces =
21
28
new ConcurrentDictionary < string , ConcurrentDictionary < Assembly , string > > ( ) ;
22
29
//private static Dictionary<string, Dictionary<string, string>> generics;
You can’t perform that action at this time.
0 commit comments