Example #1
0
 public ModuleInfo LoadModuler(ModuleManifest moduleManifest)
 {
     var(_, alc) = HostLoader.LoadPlugin(new PluginInfo
     {
         PluginName = moduleManifest.ModuleName,
         PluginDll  = moduleManifest.ModuleEntrypoint
     });
     return(new ModuleInfo
     {
         Alc = alc,
         ModuleAssembly = alc.EntryAssemlby,
         Manifest = moduleManifest
     });
 }
        public Assembly LoadModuler(ModuleManifest moduleManifest)
        {
            if (_hostLoader == null)
            {
                var modules = this.GetModules().Select(m => new LazyMan.ModularLoader.Graph.PluginInfo
                {
                    PluginName = m.ModuleName,
                    PluginDll  = m.ModuleEntrypoint
                });
                _hostLoader = new HostLoader(modules);
                //_hostLoader.AddSharedAssembly(typeof(IWebHost).Assembly,
                //    typeof(Microsoft.Extensions.Hosting.IHostBuilder).Assembly,
                //    typeof(IHost).Assembly);
            }

            return(_hostLoader.LoadPlugin(new Graph.PluginInfo
            {
                PluginName = moduleManifest.ModuleName,
                PluginDll = moduleManifest.ModuleEntrypoint
            }));
        }