using System; using NLog; using System.Web.Optimization; [assembly: WebActivatorEx.PreApplicationStartMethod(typeof(Penseesoft.Web.Setting.App_Start.BundleTableSetting), "PreStart")] [assembly: WebActivatorEx.PostApplicationStartMethod(typeof(Penseesoft.Web.Setting.App_Start.BundleTableSetting), "PostStart")] namespace Penseesoft.Web.Setting.App_Start { public static class BundleTableSetting { public static void PreStart() { LogManager.GetCurrentClassLogger().Trace("PreStart"); BundleTable.EnableOptimizations = false; LogManager.GetCurrentClassLogger().Trace("BundleTable.EnableOptimizations is false"); } public static void PostStart() { LogManager.GetCurrentClassLogger().Trace("PostStart"); } } }
WebActivatorEx的用法,
assembly的Attribute不能包含在namespace内,为了这个弄了几小时orz
原文:http://www.cnblogs.com/peteryu007/p/5123353.html