AI Chat Web template: scaffolded Identity pages are inaccessible because App.razor applies an interactive render mode unconditionally
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp
- Domain
- authentication, frontend
Research direction
Start in the template's App.razor, where HeadOutlet and Routes receive an unconditional render mode; the issue includes the PageRenderMode pattern using HttpContext.AcceptsInteractiveRouting. Reproduce by creating the AI Chat Web template, scaffolding Identity, and navigating to /Account/Register. Done means Identity pages render via static SSR while the chat remains interactive; if maintainers prefer the documentation option, add a note near the Identity scaffolding guidance.
Written by the indexing model from the issue text.
Description
Summary
In the AI Chat Web template, App.razor applies an interactive render mode to HeadOutlet and Routes unconditionally. As a result, pages that opt out with [ExcludeFromInteractiveRouting], such as the scaffolded ASP.NET Core Identity pages don't work. The project builds without errors, so the problem only shows up at runtime.
Environment
- .NET SDK: 10.0.401
- Template package: Microsoft.Extensions.AI.Templates 10.11.0-preview.3.26513.7
- IDE: Visual Studio 26 (18.10.3)
- OS: Windows 10 Pro
Steps to reproduce
- Create a new project from the AI Chat Web App template: OpenAI, vector store, Keyless Auth
- Scaffold ASP.NET Core Identity: Add > New Scaffolded Item > Identity (all)
- Build (succeeds) and run.
- Navigate to /Account/Register
Expected behavior
Identity pages render via static SSR so they can use HttpContext and set authentication cookies. The AI chat keeps its interactive rendering.
Actual behavior
Navigating to /Account/Register renders the template's styling but an empty content area.
No exception is thrown, there is nothing in the browser console / server log, and the build is clean.
Cause
[ExcludeFromInteractiveRouting] works as intended, but the root components still apply an interactive render mode regardless of the route:
<HeadOutlet @rendermode="@renderMode" />
<Routes @rendermode="@renderMode" />
Suggested change
Choose the render mode per request, so routes that opt out of interactive routing fall back to static SSR:
<HeadOutlet @rendermode="@PageRenderMode" />
<Routes @rendermode="@PageRenderMode" />
@code {
[CascadingParameter]
private HttpContext HttpContext { get; set; } = default!;
private IComponentRenderMode? PageRenderMode =>
HttpContext.AcceptsInteractiveRouting()
? new InteractiveServerRenderMode(prerender: false)
: null;
}
This is the same pattern used when Individual Accounts authentication is selected in the standard Blazor Web App template, and it matches the workaround discussed in dotnet/aspnetcore#51170. I confirmed that with this change the AI chat still works as interactive and the Identity pages load.
Scope
I'm not proposing to include Identity in the template. Either of these would help:
- make the template's
App.razorrouting-aware, as above, or - add a short note to the template docs explaining when to add this switch (for example, before scaffolding Identity).
- Dominant language
- C#
- Stars
- 3.3k
- Forks
- 916
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 41
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/extensions
-
area-ai bug untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
dotnet/extensions#7893 ·
Maintainers usually reply within 1 day
-
HTTP logging truncates catch-all route parameters in the formatted request pathPossibly taken @johnkaram02 claimed this 5 days ago. Openarea-telemetry untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/extensions#7883 ·
Maintainers usually reply within 1 day
-
Managed DNS resolver ignores tab-separated nameserver lines in /etc/resolv.confPossibly taken @johnkaram02 claimed this 5 days ago. Openneeds-area-label untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/extensions#7881 ·
Maintainers usually reply within 1 day
-
[Microsoft.Extensions.AI.OpenAI] AsOpenAIStreamingChatCompletionUpdatesAsync writes finish_reason "stop" on every chunk with a null FinishReasonPossibly taken @nurullahturkoglu claimed this 8 days ago. Openarea-ai untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
dotnet/extensions#7863 ·
Maintainers usually reply within 1 day
-
Outgoing HttpClient LatencyInfo enricher value has incomplete escapingPossibly taken @zjdangge claimed this 9 days ago. Openarea-telemetry untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/extensions#7757 · 1 comment ·
Maintainers usually reply within 1 day
All issues in dotnet/extensions
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug 優先: 低
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
.NET area: storage bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Larson-Logan/medal-sync#61 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day