MVC2到MVC3 IOC问题
我刚刚从 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);
}
}
有什么想法吗?
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要实现 MVC3 方法。以下内容将修复它:
http://blog.janjonas.net/2011-05-30/aspnet-mvc-fix-icontrollerfactory-implementation-upgrading-mvc_2-mvc_3
You need to implement the MVC3 method. The following will fix it:
http://blog.janjonas.net/2011-05-30/aspnet-mvc-fix-icontrollerfactory-implementation-upgrading-mvc_2-mvc_3