If I add an explicit call to app.UseRouting() in a Blazor Web App, I get the following exception:
"Endpoint / (/) contains anti-forgery metadata, but a middleware was not found that supports anti-forgery."
Repro steps:
- Create a Blazor Web App
- Update Program.cs to call app.UseRouting() explicitly:
app.UseRouting();
app.MapRazorComponents<App>();
Expected result: App runs without error
Actual result: Exception saying that the antiforgery middleware is required
Workaround: Adding the antiforgery middleware resolves the issue
.NET SDK version: 8.0.100-preview.7.23375.2