Skip to content

Suggestion: Enhance section on changing the default render mode for an app #31078

Closed
@TheCakeMonster

Description

@TheCakeMonster

Description

[Enter feedback here]
If you create an app from the Blazor Web App template using the Auto (Server and Client) rendering mode option and then, later, choose to manually change the render mode for the whole application, the section of this document that shows setting @rendermode on the Routes component only works correctly if you choose InteractiveServer. If you choose InteractiveWebAssembly or InteractiveAuto then an error message is generated in the console, because the Routes component cannot be found.

The Routes component needs to be moved to the Client project for this section of the document to work. That also requires moving the MainLayout and NavMenu components.

I think explaining the need for the Routes component to be in the Client project might help some people understand the error message that is written to the console, if they encounter it. I only resolved the problem by rewatching Steve Sanderson's .NET Conf session again, where he explains this during the demo.

Error: One or more errors occurred. (Root component type 'ABC.Components.Routes' is not found in project 'ABC')

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/components/render-modes.md

Document ID

7c9948a3-9886-8097-6014-492a4c21ea4e

Article author

guardrex

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions