static AssemblyDomain() { var defaultDomain = DomainManagement.RegisterDefault <AssemblyDomain>(); foreach (var asm in DependencyContext .Default .CompileLibraries .SelectMany(cl => cl.ResolveReferencePaths())) { defaultDomain.ShortReferences.Add(asm); } }
static AssemblyDomain() { _defaultDomain = DomainManagement.RegisterDefault <AssemblyDomain>(); _shareLibraries = new ConcurrentQueue <string>(); var assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (var asm in assemblies) { try { _shareLibraries.Enqueue(asm.Location); } catch (Exception) { } } }