dotnet / dotnet/aspnetcore

Using MapFallbackToPage with a page called Index.cshtml leads to an ambiguious match

Open
#12,705 15 comments 6 reactions 0 assignees View on GitHub
affected-very-few area-mvc bug feature-routing severity-minor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

**Repro**

1. Create a new Server-Side Blazor app.
2. Rename `Pages/_Host.cshtml` -> `Pages/Index.cshtml`.
3. Navigate to `/Index` in the app.

This results in an ambiguous match from routing because a page named `Index` produces two endpoints. This isn't ideal because it can be a useful pattern to place a page in the app route and then use fallback routing.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.