示例#1
0
        static AssemblyDomain()
        {
            var defaultDomain = DomainManagement.RegisterDefault <AssemblyDomain>();

            foreach (var asm in DependencyContext
                     .Default
                     .CompileLibraries
                     .SelectMany(cl => cl.ResolveReferencePaths()))
            {
                defaultDomain.ShortReferences.Add(asm);
            }
        }
示例#2
0
        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)
                {
                }
            }
        }