Closed jentrinanes closed 9 years ago
The stack trace is a little misleading. The error is not due to routing, but it is a problem with dependency injection. MvcSiteMapProvider's controller factory only instantiates the type XmlSiteMapController. It wraps the IControllerFactory implementation of the MVC application using a decorator pattern (whether it is the default or a custom one) in order to provide this one special case. So the issue you are having is because the upstream IControllerFactory you have configured is not returning a controller instance when you navigate to that URL, it actually has nothing to do with MvcSiteMapProvider.
Is there a way to handle invalid url / route in MvcSiteMapProvider?
I'm getting a "The IControllerFactory 'MvcSiteMapProvider.DI.ControllerFactoryDecorator' did not return a controller for the name 'foo'." error when trying an invalid url. I need to implement a custom 404 error page for this.