Bug in MvcFutures LinkBuilder.BuildUrlFromExpression

Posted by rboarman on Stack Overflow See other posts from Stack Overflow or by rboarman
Published on 2010-05-03T23:51:55Z Indexed on 2010/05/03 23:58 UTC
Read the original article Hit count: 508

Filed under:

I hope this is the right place to post this. The following code fails in the latest build of the MVC futures library.

This works and correctly calls my controller:

Html.ActionLink<CreatePlayerController>(x => x.PlayerDetails(), "Click") 

This fails:

    LinkBuilder.BuildUrlFromExpression<CreatePlayerController>(null,
 Html.RouteCollection,  x => x.PlayerDetails() )

The error is:

System.InvalidOperationException: The IControllerFactory 'SF.Client.Website.StructureMapControllerFactory' did not return a controller for the name 'CreatePlayer'.

My StructureMapControllerFactory. GetControllerInstance method is never called.

Do I need to register my controller factory in some other way? It seems like the MvcFutures code is ignoring it.

ControllerBuilder.Current.SetControllerFactory(new StructureMapControllerFactory());

Thank you,

Rick

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2