「未實現IControllerFactory.CreateController」 當編譯此代碼:在Visual Studio 2010
public class WindsorControllerFactory : IControllerFactory
{
private readonly WindsorContainer _container;
public WindsorControllerFactory(WindsorContainer container)
{
_container = container;
}
public IController CreateController(RequestContext requestContext,
string controllerName)
{
return (IController)_container.Resolve(controllerName);
}
public void ReleaseController(IController controller)
{
_container.Release(controller);
}
}
我收到此錯誤:
'WindsorControllerFactory' does not implement interface member 'System.Web.Mvc.IControllerFactory.CreateController(System.Web.Routing.RequestContext, string)'
那麼,它顯然實現了這個成員。有沒有人遇到過這個問題?
我在RTM上轉載了這個,打開了ticket with Microsoft。
嘗試右鍵單擊IControllerFactory後面的「:」並說實現界面,錯過會出現 – 2010-04-10 14:03:13
@Oskar - 沒有錯過的方法,這就是問題所在。如果我註釋掉CreateController方法,並使用Resharper執行「實現方法」,則代碼仍然不能編譯。 – ripper234 2010-04-10 14:04:41
嘗試明確實施嗎? – 2010-04-10 14:05:44