Description
Repro steps:
- Install .NET 10 Preview 6 (10.0.100-preview.6.25321.102)
- Create a default Blazor Web App
- Update Home.razor with:
@page "/"
@inject NavigationManager NavigationManager
<PageTitle>Home</PageTitle>
<h1>Hello, world!</h1>
Welcome to your new app.
@code {
[SupplyParameterFromQuery]
public string? Id { get; set; }
protected override async Task OnInitializedAsync()
{
await Task.Delay(1000);
if (!string.IsNullOrEmpty(Id))
{
NavigationManager.NotFound();
}
}
}
- Run the app and browse to /?id=123
Expected result: NotFound page rendered with a 404 status code
Actual result: Home page is rendered with a 404 status code