I just migrated from MVC2 to MVC3 and I got the following error when I build the project :
RhinoIoCControllerFactory does not implement interface member System.Web.Mvc.IControllerFactory.GetControllerSessionBehavior(System.WebRouting.RequestContext,string)
Here is rhe class where the error come from :
        public class RhinoIoCControllerFactory : IControllerFactory
        {
            public IController CreateController(RequestContext requestContext, string controllerName)
            {
                return IoC.Resolve<IController>((controllerName + "Controller").ToLower());
            }
            public void ReleaseController(IController controller)
            {
                IoC.Container.Release(controller);
            }
        }
Any ideas ?
Thanks
You need to implement the MVC3 method. The following will fix it:
  public SessionStateBehavior GetControllerSessionBehavior(RequestContext requestContext, string controllerName)
  {
    return SessionStateBehavior.Default;
  }
http://blog.janjonas.net/2011-05-30/aspnet-mvc-fix-icontrollerfactory-implementation-upgrading-mvc_2-mvc_3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With