我刚刚从MVC2迁移到MVC3,我在构建项目时遇到以下错误:
RhinoIoCControllerFactory没有实现接口成员System.Web.Mvc.IControllerFactory.GetControllerSessionBehavior(System.WebRouting.RequestContext,string)
这是错误的来自:
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);
}
}
有什么想法吗?
由于
答案 0 :(得分:12)
您需要实现MVC3方法。以下将解决它:
public SessionStateBehavior GetControllerSessionBehavior(RequestContext requestContext, string controllerName)
{
return SessionStateBehavior.Default;
}