public static void Start() { _pluginConfigManager.LoadResource(BundleTable.Bundles, HostingEnvironment.MapPath("~/Configs/Bundle.config"), true); _webPluginManager.RegisterWebPluginRoutesAndBundles( RouteTable.Routes, BundleTable.Bundles); GlobalConfiguration.Configure( _webApiPluginManager.RegisterWebApiPlugin); _container = _container.WithWebApi(GlobalConfiguration.Configuration, _webApiPluginManager.WebApiPluginAssemblys, throwIfUnresolved: type => type.IsApiController()); ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new PluginsRazorViewEngine()); log4net.Config.XmlConfigurator.ConfigureAndWatch( new FileInfo(HostingEnvironment.MapPath("~/Configs/Log4Net.xml"))); }
public void RegisterWebPluginRoutesAndBundles(RouteCollection routes, BundleCollection bundles) { Type iPluginType = typeof(IWebPlugin); PluginConfigManager bundleConfig = new PluginConfigManager(); foreach (Assembly asm in _webPluginAssemblys) { foreach (Type type in asm.GetTypes()) { if (iPluginType.IsAssignableFrom(type)) { IWebPlugin plugin = Activator.CreateInstance(type) as IWebPlugin; bundleConfig.LoadResource(bundles, Path.Combine( _webPluginsPath, plugin.Name, @"Configs\Bundle.config")); plugin.RegisterRoutes(routes); plugin.RegisterBundles(bundles); break; } } } }