You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The "pattern" paramter of Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapFallback is ignored when EnableRequestDelegateGenerator is true #65992
The pattern paramter of Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapFallback is ignored when EnableRequestDelegateGenerator is true
This means that the following code only works when EnableRequestDelegateGenerator is set to false
varbuilder=WebApplication.CreateBuilder(args);varapp=builder.Build();app.MapFallback("{*path}",(HttpContextcontext)=>"this is {*path}");app.MapFallback("{*path:nonfile}",(HttpContextcontext)=>"this is {*path:nonfile}");app.Run();
but if I run the code with EnableRequestDelegateGenerator set to true 😥
Connection id "0HNKBFUONIV8B", Request id "0HNKBFUONIV8B:00000003": An unhandled exception was thrown by the application.
Microsoft.AspNetCore.Routing.Matching.AmbiguousMatchException: The request matched multiple endpoints. Matches:
{*path:nonfile}
{*path:nonfile}
at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ReportAmbiguity(Span`1 candidateState)
Activity