dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.37k stars 9.99k forks source link

Hot reload becomes very slow with dotnet watch and Blazor #52757

Closed antoine-defrahan closed 8 months ago

antoine-defrahan commented 10 months ago

Is there an existing issue for this?

Describe the bug

I'm making a Blazor app with .NET 8.0.100 and try to use the Hot Reload functionality of the dotnet watch command.

It works fine at first, then usually after a few minutes of usage it becomes increasingly slow and can take up to minutes to detect a change in the code. It looks like the time to detect a change is approximately doubled each time (see screenshot below).

image

Expected Behavior

Relatively fast detection of changes and browser refresh when using dotnet watch.

Steps To Reproduce

Exceptions (if any)

No response

.NET Version

8.0.100

Anything else?

I tried using different browsers but the problem remained.

IDE

VS Code 1.85.0

dotnet --info output

.NET SDK: Version: 8.0.100 Commit: 57efcf1350 Workload version: 8.0.100-manifests.6c33ef20

Runtime Environment: OS Name: ubuntu OS Version: 22.04 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/8.0.100/

.NET workloads installed: Workload version: 8.0.100-manifests.6c33ef20 There are no installed workloads to display.

Host: Version: 8.0.0 Architecture: x64 Commit: 5535e31a71

.NET SDKs installed: 8.0.100 [/usr/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 7.0.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 7.0.11 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found: None

Environment variables: Not set

global.json file: Not found

antoine-defrahan commented 10 months ago

It behaves better when I disable Auto-Save in VS Code. It seems to delay the issue. Almost like making too many edits too fast makes the software stuck somewhere.

Edit 12/15/23 - It doesn't seem to be much correlated after all; the behavior for Hot Reload to become stuck seems to be rather random

mkArtakMSFT commented 10 months ago

Thanks for contacting us. What project are you making your edits in? Can you share more details about the exact scenario where you hit this problem?

ghost commented 10 months ago

Hi @antoine-defrahan. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

KennethHoff commented 10 months ago

I also experienced this when I was testing out Blazor SSR about a month ago. It was almost like it was recompiling every generation instead of only the newest, but that's just a hypothesis

antoine-defrahan commented 10 months ago

Hi @mkArtakMSFT, thanks for your reply.

I'm currently only making edits in the server folder of the project. The pages are rendered either with Static Server or with Interactive Server modes.

It usually goes like this:

  1. I execute successfully dotnet watch in a terminal to build and run the project.
  2. I open the browser tab to access the app and start making changes in a Razor component
  3. Hot Reload usually works fine at first and then some time after that (haven't found any pattern yet), it takes longer than usual and the time to detect changes increases (usually more or less double each time)
  4. Sometimes Hot Reload comes back and executes quickly, sometimes it stays stuck and the time to detect changes keeps on increasing. Sometimes it's a mix of both

I tried not editing any C# code and making only markup edits in .razor files, but the problem remained even so.

I have to mention that someone is working with me on the same project but on a Windows machine with Visual Studio. Hot Reload seems to work fine for him. @KennethHoff are you on Linux as well ?

Is there a way to get more verbose logs for Hot Reload? I tried setting the env variable Microsoft_CodeAnalysis_EditAndContinue_LogDir as per #52596, but couldn't find anything relevant after Hot Reload became stuck:

Trace.log

Checksum differs for source file '/myHiddenPathToServerFolder/obj/Debug/net8.0/BeautifulSports.AssemblyInfo.cs'

Session #1 started.

EmitSolutionUpdate 1.1: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.1 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.2: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.2 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.3: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.3 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.4: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.4 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.5: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.5 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.6: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.6 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.7: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.7 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.8: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.8 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.9: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.9 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.10: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.10 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.11: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.11 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.12: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.12 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.13: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.13 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

EmitSolutionUpdate 1.14: '<null>'

Found 1 potentially changed document(s) in project '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Document changed, added, or deleted: 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs'

Project summary for '/myHiddenPathToServerFolder/BeautifulSports.csproj': ValidChanges

Emitting update of '/myHiddenPathToServerFolder/BeautifulSports.csproj'

Solution update 1.14 status: Ready

Module update: capabilities=[Baseline], types=[02000057,020000AC], methods=[0600024F,06000250]

Solution update diagnostics: #1 [/myHiddenPathToServerFolder/BeautifulSports.csproj: /myHiddenPathToServerFolder/Migrations/20231207154528_InitDB.cs(1,7): hidden CS8933: The using directive for 'System' appeared previously as global using, ...]

Session #1 ended.

Analysis.log

Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
Capabilities required by 'Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_Pages_Dashboard_razor.g.cs': Baseline
KennethHoff commented 10 months ago

@antoine-defrahan I was experiencing this issue on Linux, yes.

danroth27 commented 9 months ago

I'm hitting this same issue repeatedly on Windows with .NET SDK version 8.0.200-preview.23624.5. I was running dotnet watch in VSCode while working Razor code in a Blazor Web App. I was not running the app in the debugger using VS Code.

Output log:

PS C:\Users\daroth\source\repos\TodoAppTest\TodoAppTest> dotnet watch --verbose
dotnet watch ⌚ Watching with Hot Reload.
dotnet watch πŸ”₯ Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload.
  πŸ’‘ Press "Ctrl + R" to restart.
dotnet watch πŸ”§ Building...
dotnet watch πŸš€ Started 'C:\Program Files\dotnet\dotnet.exe' with arguments 'msbuild /nologo /t:Build /restore': process id 26992
  Determining projects to restore...
  All projects are up-to-date for restore.
C:\Program Files\dotnet\sdk\8.0.200-preview.23624.5\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(311,5): message NETSDK1057: You are using a preview version o
f .NET. See: https://aka.ms/dotnet-support-policy [C:\Users\daroth\source\repos\TodoAppTest\TodoAppTest\TodoAppTest.csproj]
  TodoAppTest -> C:\Users\daroth\source\repos\TodoAppTest\TodoAppTest\bin\Debug\net8.0\TodoAppTest.dll
dotnet watch ⌚ Process id 26992 ran for 1742ms
dotnet watch ⌚ Running MSBuild target 'GenerateWatchList' on 'C:\Users\daroth\source\repos\TodoAppTest\TodoAppTest\TodoAppTest.csproj'
dotnet watch πŸš€ Started 'C:\Program Files\dotnet\dotnet.exe' with arguments 'msbuild /nologo C:\Users\daroth\source\repos\TodoAppTest\TodoAppTest\TodoAppTest.csproj /p:_DotNetWatchListFile=C:\Users\daroth\AppData\Local\Temp\tmpi5egus.tmp /nologo /v:n /t:GenerateWatchList /p:DotNetWatchBuild=true /p:DesignTimeBuild=true "/p:CustomAfterMicrosoftCommonTargets=C:\Program Files\dotnet\sdk\8.0.200-preview.23624.5\DotnetTools\dotnet-watch\8.0.200-preview.23624.3\tools\net8.0\any\DotNetWatch.targets" "/p:CustomAfterMicrosoftCommonCrossTargetingTargets=C:\Program Files\dotnet\sdk\8.0.200-preview.23624.5\DotnetTools\dotnet-watch\8.0.200-preview.23624.3\tools\net8.0\any\DotNetWatch.targets" /p:_DotNetWatchTraceOutput=true': process id 39692
dotnet watch ⌚ Process id 39692 ran for 576ms
dotnet watch ⌚ Watching 18 file(s) for changes
dotnet watch ⌚ dotnet-watch is configured to launch a browser on ASP.NET Core application startup.
dotnet watch ⌚ Configuring the app to use browser-refresh middleware.
dotnet watch ⌚ Refresh server running at wss://localhost:49609,ws://localhost:49610.
dotnet watch πŸ”₯ HotReloadProfile: Default.
dotnet watch ⌚ Connecting to the application.
dotnet watch ⌚ Running TodoAppTest with the following arguments: ''
dotnet watch πŸš€ Started 'C:\Users\daroth\source\repos\TodoAppTest\TodoAppTest\bin\Debug\net8.0\TodoAppTest.exe' with arguments '': process id 16420
dotnet watch πŸš€ Started
dotnet watch πŸ”₯ Hot reload capabilities: Baseline AddMethodToExistingType AddStaticFieldToExistingType AddInstanceFieldToExistingType NewTypeDefinition ChangeCustomAttributes UpdateParameters GenericUpdateMethod GenericAddMethodToExistingType GenericAddFieldToExistingType.
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5206
dotnet watch ⌚ Launching browser.
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\Users\daroth\source\repos\TodoAppTest\TodoAppTest
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
      Failed to determine the https port for redirect.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 621.0727ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 133.2512ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 53.2432ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ No hot reload changes to apply.
dotnet watch ⌚ Updating diagnostics in the browser.
dotnet watch πŸ”₯ Hot reload change handled in 4.099ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 34.1457ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 25.4026ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 43.6437ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 33.5473ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 47.6799ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ No hot reload changes to apply.
dotnet watch ⌚ Updating diagnostics in the browser.
dotnet watch πŸ”₯ Hot reload change handled in 2.063ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 79.4017ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 250.6615ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 239.6079ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 444.5058ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 802.7449ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 1580.9929ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 3246.986ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 6121.151ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 12422.1112ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 24387.3094ms.
dotnet watch ⌚ File changed: .\Components\Pages\Todos.razor.
dotnet watch ⌚ Received successful apply from delta applier.
dotnet watch πŸ”₯ Hot reload of changes succeeded.
dotnet watch ⌚ Refreshing browser.
dotnet watch πŸ”₯ Hot reload change handled in 49129.9367ms.

The "File changed" log shows up immediately, and then the long delay happens before "received successful apply from delta applier" and the rest shows up.

danroth27 commented 9 months ago

Updating issue title, since this issue doesn't appear to be Ubuntu specific.

luetm commented 8 months ago

I have the same experience. Windows 11, 8.0.200-preview.23624.5, using Rider.

mkArtakMSFT commented 8 months ago

Thank you, @jacdavis πŸ‘

SteveDunn commented 2 weeks ago

I'm experiencing it too. My scenario is that I had a project, a Blazor server project, and hot reload worked perfectly. I needed to make a bunch of changes, and it meant it was quicker to create a new project from scratch and copy just the pages that I needed from the old project. After migrating to the new project, the app ran fine. Everything worked except hot reload. So, with the new app on the left, and the old app on the right, I ran dotnet watch with --verbose.

The most interesting difference that I observed in the output was that the old app had these 'capabilities' that the new app didn't: GenericUpdateMethod GenericAddMethodToExistingType GenericAddFieldToExistingType.

I think that the most important capability is GenericUpdateMethod.

Any clues? I've put below the log line from the different versions.


New project:

dotnet watch πŸ”₯ Hot reload capabilities: Baseline AddMethodToExistingType AddStaticFieldToExistingType AddInstanceFieldToExistingType NewTypeDefinition ChangeCustomAttributes UpdateParameters.

Old project:

dotnet watch πŸ”₯ Hot reload capabilities: Baseline AddMethodToExistingType AddStaticFieldToExistingType AddInstanceFieldToExistingType NewTypeDefinition ChangeCustomAttributes UpdateParameters GenericUpdateMethod GenericAddMethodToExistingType GenericAddFieldToExistingType.
danroth27 commented 2 weeks ago

Hi @SteveDunn. Could you please open a new issue instead of commenting on this closed one? Please also provide details on the exact .NET version & VS version that you are using. If you can provide the problematic project as a GitHub repo, that would help too.

SteveDunn commented 1 week ago

Thanks @danroth27 . I plan on documenting my findings and, if time permits, to contribute a change to the msbuild target. I think with a suitable warning from that target, it would solve a lot of confusion as to why it doesn't work