I think maybe you have to change your Controller type from Controller to SurfaceController, because your yellow screen makes clear that LightInject is unable to resolve your ToolsController.
Maybe registering your Controller as a type with composition.Register<ToolsController>() or something like that within a IUserComposerworks as well, but I'm not sure about that.
You can register your controller as below, however I still haven't been able to get a custom route working myself :D
public class RegisterCustomRouteComposer : ComponentComposer<RegisterCustomRouteComponent>
{
public override void Compose(Composition composition)
{
//You can do this for a single controller - Lifetime is MEGA important
composition.Register(typeof(Vantage.Controllers.BusinessController), Lifetime.Request);
}
}
Custom MVC Route Just Aint Working
Hi there, I was hoping someone could help me out with something that is no doubt blatantly obvious, but I'm stuck...
I am attempting to register a custom MVC route using components and I have done the following:
But when trying to load this I get the following YSOD:
Any help here would be greatly appreciated. Thank you
Hi Warren,
I think maybe you have to change your Controller type from
Controller
toSurfaceController
, because your yellow screen makes clear that LightInject is unable to resolve your ToolsController.Maybe registering your Controller as a type with
composition.Register<ToolsController>()
or something like that within aIUserComposer
works as well, but I'm not sure about that.Give it a try.
Corné
Interesting.. thank you that's worked.
I'm not to confident with IUserComposer just yet, but that may have cropped up in the next error I've hit.
See the documentation for how Composing works:
https://our.umbraco.com/documentation/implementation/composing/
Corné
You can register your controller as below, however I still haven't been able to get a custom route working myself :D
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.