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 122 posts 574 karma points c-trib
    Nov 05, 2019 @ 14:50
    Dave de Moel
    0

    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 273 karma points
    Feb 08, 2021 @ 19:19
    Shola
    0

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

  • Stefano Beretta 102 posts 247 karma points
    Apr 08, 2021 @ 09:53
    Stefano Beretta
    0

    Hi! Any news about it?

    Thanks

    S

  • 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.

Please Sign in or register to post replies