protected void Application_Start() { AreaRegistration.RegisterAllAreas(); //启用route特性 GlobalConfiguration.Configure(WebApiConfig.Register); //WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); //BundleConfig.RegisterBundles(BundleTable.Bundles); //GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); var filePath = HttpContext.Current.Server.MapPath("~/log/import_log.txt"); Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .WriteTo.File(filePath, rollingInterval: RollingInterval.Day) .CreateLogger(); }