fix: re-execute status-code pages in their own DI scope#86
Merged
Conversation
UseStatusCodePagesWithReExecute("/not-found") re-executed within the
original request's service scope. When that request already rendered a
Razor component — e.g. a host page that set a bare 4xx status — the
second render crashed with "'RemoteNavigationManager' already
initialized" and the response became a 500.
Pass createScopeForStatusCodePages: true (analogous to the existing
createScopeForErrors: true on UseExceptionHandler) so the re-executed
render gets fresh scoped services.
andregoepel
force-pushed
the
bugfix/status-code-pages-scope
branch
from
July 12, 2026 02:28
97521f9 to
5a98c94
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Beim Verifizieren des Design-Upgrades in
andregoepel-devgefunden:UseStatusCodePagesWithReExecute("/not-found", "?code={0}")aus #83 re-executet im Service-Scope des Original-Requests. Hat der Request vorher schon eine Razor-Komponente gerendert (z. B. eine Host-Seite, die einen bare-4xx-Status setzt), crasht der zweite Render:→ Response wird ein 500 statt der designten Fehlerseite.
Fix:
createScopeForStatusCodePages: true(neuer .NET-10-Parameter, analog zum bestehendencreateScopeForErrors: trueamUseExceptionHandler), damit die Re-Execution frische scoped Services bekommt.Build 0 Fehler, Tests 57/57 grün. Sollte als 1.2.1 released werden, da alle Consumer von
UseAppFoundation()betroffen sind.