protected void Application_Start()
        {
            VersionLogging.SetVersion();
            RuntimeHelper.SetRuntimeName("SFA.Apprenticeships.Web.Manage");

            AreaRegistration.RegisterAllAreas();

            var container = (IContainer)DependencyResolver.Current.GetService(typeof(IContainer));

            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters, container);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            GlobalConfiguration.Configure(WebApiConfig.Register);

            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new RazorViewEngine());

            ControllerBuilder.Current.SetControllerFactory(new DefaultControllerFactory());

            ModelBinders.Binders.DefaultBinder = new TrimModelBinder();
            FluentValidationModelValidatorProvider.Configure(provider =>
            {
                provider.AddImplicitRequiredValidator = false;
                provider.Add(typeof(EqualValidator),
                             (metadata, context, description, validator) =>
                             new EqualToValueFluentValidationPropertyValidator(metadata, context, description, validator));
            });

            // This header cannot be removed using web.config --> http://www.codeproject.com/Tips/785867/ASP-NET-MVC-Remove-IIS-Header-Bloat
            MvcHandler.DisableMvcResponseHeader = true;
        }
Beispiel #2
0
        private void Initialise()
        {
            VersionLogging.SetVersion();

            try
            {
                InitializeIoC();
            }
            catch (Exception ex)
            {
                if (_logger != null)
                {
                    _logger.Error(ProcessName + " failed to initialise", ex);
                }
                throw;
            }
        }
        private void Initialise()
        {
            VersionLogging.SetVersion();

            try
            {
                InitializeIoC();
                InitialiseServiceBus();
                SubscribeServiceBusMessageBrokers();
            }
            catch (Exception ex)
            {
                if (_logger != null)
                {
                    _logger.Error(ProcessName + " failed to initialise", ex);
                }
                throw;
            }
        }
Beispiel #4
0
        private void Initialise()
        {
            try
            {
                VersionLogging.SetVersion();

                InitializeIoC();
            }
            catch (Exception e)
            {
                if (_logService == null)
                {
                    Trace.TraceError($"{ProcessName} failed to initialise: \"{e}\"");
                }
                else
                {
                    _logService.Error($"{ProcessName} failed to initialise");
                }

                throw;
            }
        }
        private void Initialise()
        {
            try
            {
                ServicePointManager.DefaultConnectionLimit = 12;
                VersionLogging.SetVersion();

                InitializeIoC();
            }
            catch (Exception e)
            {
                if (_logService == null)
                {
                    Trace.TraceError("{0} failed to initialise: \"{1}\"", ProcessName, e);
                }
                else
                {
                    _logService.Error(ProcessName + " failed to initialise", e);
                }

                throw;
            }
        }