Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filters not firing for MVC Area #47

Closed
dmeagor opened this issue Feb 2, 2018 · 1 comment
Closed

Filters not firing for MVC Area #47

dmeagor opened this issue Feb 2, 2018 · 1 comment

Comments

@dmeagor
Copy link

dmeagor commented Feb 2, 2018

Hi

Been working on this for two days now without luck. Does anyone know why the filters (in this case the UnitOfWorkFilter) are not firing for the controllers within an MVC Area. Everything else seems to be working ok.

Binding in: public override void Load()

Kernel.BindFilter<UnitOfWorkFilter>(FilterScope.Action, 0);

Ninject is starting using PreApplicationStartMethod rather than extending HttpApplication. Could this be the cause?

[assembly: WebActivator.PreApplicationStartMethod(typeof(NinjectWebCommon), "Start")]
[assembly: WebActivator.ApplicationShutdownMethod(typeof(NinjectWebCommon), "Stop")]

namespace FreeSurvey.Web.Mvc
{
    public static class NinjectWebCommon
    {
        private static readonly Bootstrapper Bootstrapper = new Bootstrapper();

        /// <summary>
        /// Starts the application
        /// </summary>
        public static void Start()
        {
            DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule));
            DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule));

            Bootstrapper.Initialize(CreateKernel);

            GlobalConfiguration.Configuration.DependencyResolver = new NinjectResolver(Bootstrapper.Kernel);
            GlobalHost.DependencyResolver = new SignalRNinjectResolver(Bootstrapper.Kernel);
            ControllerBuilder.Current.SetControllerFactory(new NinjectControllerFactory(Bootstrapper.Kernel));
        }
@dmeagor
Copy link
Author

dmeagor commented Feb 3, 2018

Please disregard. I got to the bottom of the issue.

@dmeagor dmeagor closed this as completed Feb 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant