54 lines
1.5 KiB
C#
54 lines
1.5 KiB
C#
|
|
using CR.Atesa.Vacaciones.App_Start;
|
||
|
|
using Newtonsoft.Json;
|
||
|
|
using NLog;
|
||
|
|
using System;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using System.Linq;
|
||
|
|
using System.Net.Http.Formatting;
|
||
|
|
using System.Web;
|
||
|
|
using System.Web.Http;
|
||
|
|
using System.Web.Mvc;
|
||
|
|
using System.Web.Optimization;
|
||
|
|
using System.Web.Routing;
|
||
|
|
|
||
|
|
|
||
|
|
namespace CR.Atesa.Vacaciones
|
||
|
|
{
|
||
|
|
public class MvcApplication : System.Web.HttpApplication
|
||
|
|
{
|
||
|
|
protected void Application_Start()
|
||
|
|
{
|
||
|
|
|
||
|
|
GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
|
||
|
|
|
||
|
|
AreaRegistration.RegisterAllAreas();
|
||
|
|
|
||
|
|
//WebApiConfig.Register(GlobalConfiguration.Configuration);
|
||
|
|
GlobalConfiguration.Configure(WebApiConfig.Register);
|
||
|
|
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
||
|
|
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
||
|
|
BundleConfig.RegisterBundles(BundleTable.Bundles);
|
||
|
|
new Ultimus.Framework.ResourceTrasform().OptimizeUltimusFrameworkBundle();
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
AuthConfig.RegisterAuth();
|
||
|
|
}
|
||
|
|
|
||
|
|
protected void Application_Error(object sender, EventArgs e)
|
||
|
|
{
|
||
|
|
Logger logger = LogManager.GetLogger("Globalasax");
|
||
|
|
|
||
|
|
Exception exception = Server.GetLastError();
|
||
|
|
|
||
|
|
Server.ClearError();
|
||
|
|
|
||
|
|
logger.Fatal("[MvcApplication / Application_Error] " + exception.ToString());
|
||
|
|
|
||
|
|
HttpContext.Current.RewritePath("Home/Error");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|