Problem MVC2-MVC3 IOC

I just switched from MVC2 to MVC3, and when creating the project I got the following error:

RhinoIoCControllerFactory does not implement a member of the System.Web.Mvc.IControllerFactory.GetControllerSessionBehavior interface (System.WebRouting.RequestContext, string)

Here is the class in which the error occurs 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

+4
source share
1 answer

You need to implement the MVC3 method. This will fix the following:

  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

+12
source

All Articles