Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Dave de Moel 121 posts 553 karma points c-trib
    Nov 05, 2019 @ 14:50
    Dave de Moel

    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

    "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?

  • Shola 65 posts 272 karma points
    Feb 08, 2021 @ 19:19

    Hello Dave, still running into this issue ourselves. Did you manage to find a solution?

  • Stefano Beretta 94 posts 238 karma points
    1 week ago
    Stefano Beretta

    Hi! Any news about it?



Please Sign in or register to post replies

Write your reply to: