Skip to content

Net Core 6 Blazor Server Hot Reload is Slow for Big Projects #32867

Closed
dotnet/sdk
#23358
@lucianparvu

Description

@lucianparvu

Hi,

I have a project Blazor Server with ~ 180 .razor Files (186 Files, 55 Folder)

If all folder structure is in the same project the hot reload takes ~ 15 seconds , more than build time ( 10 seconds ) .

If we split the .razor files on Libraries , we get the next Results

Main App (Only Host.razor) : (Reference to Shared Library, Front Library,Admin Library )
– Hot Reload for all tests after 1 seconds

Shared Library (21 Files, 1 Folder) : Layout, Shared Components, etc
– Add p: Hot Reload after 2-3 seconds
– Add style to p : Hot Reload after after 2-3 seconds
– Counter Example with ++ : Hot Reload after 1 seconds

Front Library (54 Files, 15 Folders) (Reference to Shared Library)
– Add p: Hot Reload after 20 seconds
– Add style to p : Hot Reload after after 4 seconds
– Counter Example with ++ : Hot Reload after 3 seconds

Admin Library (106 Files, 36 Folders) (Reference to Shared Library)
– Add p: Hot Reload after 12 seconds
– Add style to p : Hot Reload after after 8 seconds
– Counter Example with ++ : Hot Reload after 8 seconds

I am suspecting maybe we have something from old Projects because we have upgraded from 2.2 to 3.1 ( Blazor ) to 5,etc

We have tried to remove html from Some razor Files specially Layout and seems to work quickly if there is just some simple html lines.

How can we improve ? It depends on File nr and complexity ? or depends on references ? How can we structure the project ?

PS: The issue is posted based on disscussion : https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-6-preview-3/comment-page-3/#comment-3245

Metadata

Metadata

Assignees

Labels

ExternalThis is an issue in a component not contained in this repository. It is open for tracking purposes.Priority:1Work that is critical for the release, but we could probably ship withoutarea-commandlinetoolsIncludes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPIbugThis issue describes a behavior which is not expected - a bug.feature-blazor-serverfeature-dotnetwatchThis issue is related to the dotnet-watch command-line tool (now external)feature-hot-reloadThis issue is related to the Hot Reload feaature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions