Skip to content

Support all subscribers to OnNotFound event #62798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Path from args has higher priority than NotFoundPage.
  • Loading branch information
ilonatommy committed Jul 18, 2025
commit 6da74c719726c04a6bf96c8e373a7001dc0a856e
17 changes: 9 additions & 8 deletions src/Components/Components/src/Routing/Router.cs
Original file line number Diff line number Diff line change
Expand Up @@ -394,17 +394,18 @@
bool renderContentIsProvided = NotFoundPage != null || args.Path != null;
if (_renderHandle.IsInitialized && renderContentIsProvided)
{
Log.DisplayingNotFound(_logger);
if (NotFoundPage == null && !string.IsNullOrEmpty(args.Path))
if (!string.IsNullOrEmpty(args.Path))
{
// The path can be set by a subscriber not defined in blazor framework.
_renderHandle.Render(builder => RenderComponentByRoute(builder, args.Path));
return;
}

// Having the path set signals to the endpoint renderer that router handled rendering.
args.Path = _notFoundPageRoute;
RenderNotFound();
else
{
// Having the path set signals to the endpoint renderer that router handled rendering.
args.Path = _notFoundPageRoute;
RenderNotFound();
}
Log.DisplayingNotFound(_logger, args.Path);
}
}

Expand Down Expand Up @@ -490,7 +491,7 @@
internal static partial void NavigatingToExternalUri(ILogger logger, string externalUri, string path, string baseUri);

[LoggerMessage(4, LogLevel.Debug, $"Displaying {nameof(NotFound)} on request", EventName = "DisplayingNotFoundOnRequest")]
internal static partial void DisplayingNotFound(ILogger logger);
internal static partial void DisplayingNotFound(ILogger logger, string displayedPath);

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Source-Build (Managed))

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux ARM)

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux ARM64)

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux x64)

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux Musl x64)

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: macOS arm64)

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux Musl ARM)

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: Linux Musl ARM64)

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Build: macOS x64)

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)

Check failure on line 494 in src/Components/Components/src/Routing/Router.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/Components/Components/src/Routing/Router.cs#L494

src/Components/Components/src/Routing/Router.cs(494,80): error SYSLIB1015: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument 'displayedPath' is not referenced from the logging message (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1015)
#pragma warning restore CS0618 // Type or member is obsolete
}
}
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy