/// <summary> /// Creates Ninject kernel. /// </summary> /// <returns></returns> protected virtual IKernel CreateKernel() { var bootstrapper = new Ninject.Web.Common.Bootstrapper(); if (bootstrapper.Kernel != null) { return(bootstrapper.Kernel); } return(new StandardKernel()); }
public void Configuration(IAppBuilder app) { var _kernel = new Ninject.Web.Common.Bootstrapper().Kernel; Hangfire.GlobalConfiguration.Configuration.UseNinjectActivator(_kernel); GlobalConfiguration.Configuration.UseSqlServerStorage("HangFire"); app.UseHangfireDashboard(); app.UseHangfireServer(); ConfigureAuth(app); createRolesandUsers(); }
/// <summary> /// Creates Ninject kernel. /// </summary> /// <returns></returns> protected virtual IKernel CreateKernel() { var bootstrapper = new Ninject.Web.Common.Bootstrapper(); IKernel kernel; if (bootstrapper.Kernel != null) { kernel = bootstrapper.Kernel; } else { var ninjectSettings = new NinjectSettings(); ninjectSettings.LoadExtensions = Config.Get <FeatherConfig>().NinjectLoadExtensions; kernel = new SitefinityKernel(ninjectSettings); } return(kernel); }
protected void Application_Start() { // MiniProfilerEF6.Initialize(); Logger = Log4NetLogger.Configure(); Logger.Information("App is starting"); AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); //RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes); DefaultModelBinder.ResourceClassKey = "ErrorMessages"; ModelMetadataProviders.Current = new CustomModelMetadataProvider(); MongoObjectIdGenerator.Register(); MongoObjectIdSerializer.Register(); BsonClassMap.RegisterConventions(new ConventionProfile().SetSerializationOptionsConvention(new LocalDateTimeSerializationConvention()), c => true); var kernel = new Ninject.Web.Common.Bootstrapper().Kernel; ServiceLocator.Resolver = kernel.GetService; BundleConfig.RegisterBundles(BundleTable.Bundles); ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new LocalizedRazorViewEngine()); ViewEngines.Engines.Add(new LocalizedWebFormViewEngine()); //GlobalFilters.Filters.Add(new StackExchange.Profiling.Data..Profiling.MVCHelpers.ProfilingActionFilter()); var chatService = ServiceLocator.Resolve <ChatService>(); chatService.ClearClients(); }