using CP.Business; using CP.Common; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; namespace CP.Web { public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); //500 筛选器 FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); //日志记录 LogHelper.SetConfig(new System.IO.FileInfo(AppDomain.CurrentDomain.BaseDirectory + "log4net.config")); } protected void Application_Error(object sender, EventArgs e) { //Exception lastError = Server.GetLastError(); //if (lastError != null) //{ // string strExceptionMessage = string.Empty; // HttpException httpError = lastError as HttpException; // if (httpError != null) // { // int httpCode = httpError.GetHttpCode(); // if (httpCode == 400 || httpCode == 404) // { // Response.StatusCode = 404; // Server.ClearError(); // return; // } // } // Response.StatusCode = 500; // Server.ClearError(); //} } } }