Hello and thanks in advance. We have been struggling with a Microsoft.AspNetCore.Routing.Matching.AmbiguousMatchException:
However, I cannot find any help as this seems to be a little different version of this error, the issue is across 2 different web apps:
they both live in azure
Here is the code:
using Microsoft.AspNetCore.Mvc; namespace FCID.MAP.API.Business.Access.Controllers { [ApiController] public class AlwaysOnController { [HttpGet] [Route("/")] public void AccessAlwaysOn() { // Root Url is used by Azure's "Always on" feature. } } } However 1 of the controllers is deployed to 1 web app, and the other controller is deployed to a different web app in the same azure resource group.
Has anyone seen this before or know how to correct it?
We have around 30 microservices as web apis, they all have similar controllers. However we are only receiving this error based on 2 of our apis..
Could it be that these are colliding somehow?
Here is the exact error message:
Microsoft.AspNetCore.Routing.Matching.AmbiguousMatchException: at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ReportAmbiguity (Microsoft.AspNetCore.Routing, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60) at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ProcessFinalCandidates (Microsoft.AspNetCore.Routing, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60) at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.Select (Microsoft.AspNetCore.Routing, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
Here is the error message:
The request matched multiple endpoints. Matches:
FCID.MAP.API.Business.Migration.Controllers.AlwaysOnController.MigrationAlwaysOn (FCID.MAP.API.Business.Migration) FCID.MAP.API.Business.Access.Controllers.AlwaysOnController.AccessAlwaysOn (FCID.MAP.API.Business.Access)
However FCID.MAP.API.Business.Migration.Controllers and FCID.MAP.API.Business.Access.Controllers
live in 2 different microservice/web apis/domains/routes. So I'm not sure how it would think there is duplication

Источник: https://stackoverflow.com/questions/780 ... hexception