DbLocalizationProvider.AdminUI.AspNetCore.Routing is messing with Optimizely/Episerver Content delivery API routing. #257
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to use this plugin in my latest CMS 12 project where we are heavily using headless content delivery APIs , the problem is when i register the admin API route in startup file endpoints.MapDbLocalizationAdminUI(); and try to call the content delivery APIs
like https://localhost:8987/myhomepage/children in postman I get this error. If i remove the above line, the call works fine. Any idea how to sort this issue.
System.InvalidCastException: Unable to cast object of type 'Microsoft.AspNetCore.Http.Endpoint' to type 'Microsoft.AspNetCore.Routing.RouteEndpoint'.
at System.Linq.Enumerable.CastIterator[TResult](IEnumerable source)+MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator
1.MoveNext() at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable1 source, Boolean& found)at EPiServer.ContentApi.Routing.Internal.ContentApiMatcherPolicy.MatchContentApiEndpoint(String url, RouteValueDictionary routeValue)
at EPiServer.ContentApi.Routing.Internal.ContentApiMatcherPolicy.ApplyAsync(HttpContext httpContext, CandidateSet candidates)
at EPiServer.Web.Routing.Matching.Internal.DefaultContentEndpointSelector.ApplyPoliciesAsync(HttpContext httpContext, CandidateSet candidates)
at EPiServer.Web.Routing.Matching.Internal.DefaultContentEndpointSelector.SelectAsync(ContentRouteData contentRouteData, HttpContext context)
at EPiServer.Web.Routing.Matching.Internal.ContentMatcherPolicy.MapEndpointAsync(Endpoint originalEndpoint, HttpContext httpContext)
at EPiServer.Web.Routing.Matching.Internal.ContentMatcherPolicy.ApplyAsync(HttpContext httpContext, CandidateSet candidates)
at Microsoft.AspNetCore.Routing.Matching.DfaMatcher.SelectEndpointWithPoliciesAsync(HttpContext httpContext, IEndpointSelectorPolicy[] policies, CandidateSet candidateSet)
at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.g__AwaitMatch|8_1(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task matchTask)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Beta Was this translation helpful? Give feedback.
All reactions