GetControllerInstance has changed from ASP.NET MVC 1.0 to ASP.NET MVC 2 due to an unsuccessful error regarding race conditions.
The signature in ASP.NET MVC 1.0 was:
protected virtual IController GetControllerInstance( Type controllerType);
And in ASP.NET MVC 2 this is:
protected virtual IController GetControllerInstance( RequestContext requestContext, Type controllerType)
In this particular case, it looks like you need to change the signature of your method to:
protected override IController GetControllerInstance( RequestContext requestContext, Type controllerType) { return (IController)container.Resolve(controllerType); }
The main condition of the race was that the RequestContext instance could be used by several simultaneous requests, which would be a serious no-no. Fortunately, this does not look like all users have encountered this problem, but it has been fixed in ASP.NET MVC 2 anyway.
Eilon
source share