You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
933 B

2 years ago
  1. using EasyBL;
  2. using System.Web;
  3. using System.Web.Http;
  4. using System.Web.Mvc;
  5. using System.Web.Routing;
  6. using System.Web.SessionState;
  7. namespace WebSite
  8. {
  9. public class WebApiApplication : HttpApplication
  10. {
  11. public override void Init()
  12. {
  13. this.PostAuthenticateRequest += (sender, e) => HttpContext.Current.SetSessionStateBehavior(SessionStateBehavior.Required);
  14. base.Init();
  15. }
  16. protected void Application_Start()
  17. {
  18. string LogWorkDir = System.Web.Hosting.HostingEnvironment.MapPath("~/");
  19. LogHelper.Init(LogWorkDir, System.IO.Path.Combine(LogWorkDir, "Log4Net.config"));
  20. AreaRegistration.RegisterAllAreas();
  21. WebApiConfig.Register(GlobalConfiguration.Configuration);
  22. FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
  23. RouteConfig.RegisterRoutes(RouteTable.Routes);
  24. }
  25. }
  26. }