Currently I am creating a client api for an app that needs to consume data from Umbraco, for that I need to version the Api for which I want to use Api Version Selector.
However, when implementing it I keep getting errors like
{
"Message": "An error has occurred.",
"ExceptionMessage": "Multiple controller types were found that match the URL. This can happen if attribute routes on multiple controllers match the requested URL.\r\n\r\nThe request has found the following matching controller types: \r\nSampleCpim.HelloWorldController\r\nSampleCpim.HelloWorld2Controller",
"ExceptionType": "System.InvalidOperationException",
"StackTrace": " at System.Web.Http.Dispatcher.DefaultHttpControllerSelector.GetDirectRouteController(IHttpRouteData routeData)\r\n at System.Web.Http.Dispatcher.DefaultHttpControllerSelector.SelectController(HttpRequestMessage request)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()"
}
I have been able to find why that exception is caused, and am searching for a solution to that problem. When booting, Umbraco implements it's own Controller selecter called the NamespaceHttpControllerSelector which is configured in the WebInitialComponent. However, even when I create my own composer with the ComposeAfter attribute I don't seem to be able to override this selector.
How can I override the NamespaceHttpControllerSelector when booting Umbraco?
Extending Umbraco Versioning the Api
Currently I am creating a client api for an app that needs to consume data from Umbraco, for that I need to version the Api for which I want to use Api Version Selector.
However, when implementing it I keep getting errors like
I have been able to find why that exception is caused, and am searching for a solution to that problem. When booting, Umbraco implements it's own Controller selecter called the
NamespaceHttpControllerSelector
which is configured in theWebInitialComponent
. However, even when I create my own composer with the ComposeAfter attribute I don't seem to be able to override this selector.How can I override the
NamespaceHttpControllerSelector
when booting Umbraco?Hello Dave, still running into this issue ourselves. Did you manage to find a solution?
Hi! Any news about it?
Thanks
S
is working on a reply...