Skip to content
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

dotnet watch: No hot reload changes to apply. #57951

Closed
1 task done
danroth27 opened this issue Sep 18, 2024 · 6 comments
Closed
1 task done

dotnet watch: No hot reload changes to apply. #57951

danroth27 opened this issue Sep 18, 2024 · 6 comments
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI feature-dotnetwatch This issue is related to the dotnet-watch command-line tool (now external)

Comments

@danroth27
Copy link
Member

danroth27 commented Sep 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When I run a Blazor Web App using dotnet watch in .NET 9 RC1, the first Razor edit fails with the message "No hot reload changes to apply."

Expected Behavior

The Razor code change applies successfully.

Steps To Reproduce

  • Install .NET 9 RC1 SDK
  • dotnet new blazor
  • dotnet watch
  • Edit the h1 in Home.razor

Expected result: Change is successfully applied and shows up in the browser
Actual result: "No hot reload changes to apply." and browser doesn't update, even after refreshing the browser
Workaround: Make multiple edits. Subsequent edits apply.

Exceptions (if any)

No response

.NET Version

9.0.100-rc.1.24452.12

Anything else?

No response

@tmat @phil-allen-msft

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI label Sep 18, 2024
@danroth27 danroth27 added the feature-dotnetwatch This issue is related to the dotnet-watch command-line tool (now external) label Sep 18, 2024
@tmat
Copy link
Member

tmat commented Sep 18, 2024

Could you please run with --verbose and attach the output?

@danroth27
Copy link
Member Author

Could you please run with --verbose and attach the output?

Sure. Here's the output after I apply two edits. The first edit doesn't seem to do anything and has the "No hot reload changes to apply" message. the second edit succeeds:

C:\Users\user\Desktop\BlazorApp>dotnet watch --verbose
dotnet watch ⌚ Working directory: 'C:\Users\user\Desktop\BlazorApp'
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 ⌚ Running MSBuild target 'GenerateWatchList' on 'C:\Users\user\Desktop\BlazorApp\BlazorApp.csproj'
dotnet watch 🚀 Launched 'C:\Program Files\dotnet\dotnet.exe' with arguments 'msbuild /nologo C:\Users\user\Desktop\BlazorApp\BlazorApp.csproj /p:_DotNetWatchListFile=C:\Users\user\AppData\Local\Temp\tmpvnk53l.tmp /nologo /v:n /t:GenerateWatchList /p:DotNetWatchBuild=true /p:DesignTimeBuild=true "/p:CustomAfterMicrosoftCommonTargets=C:\Program Files\dotnet\sdk\9.0.100-rc.1.24452.12\DotnetTools\dotnet-watch\9.0.100-rc.1.24452.12\tools\net9.0\any\DotNetWatch.targets" "/p:CustomAfterMicrosoftCommonCrossTargetingTargets=C:\Program Files\dotnet\sdk\9.0.100-rc.1.24452.12\DotnetTools\dotnet-watch\9.0.100-rc.1.24452.12\tools\net9.0\any\DotNetWatch.targets" /p:_DotNetWatchTraceOutput=true': process id 3856
dotnet watch ⌚ Process id 3856 ran for 702ms.
dotnet watch ⌚ Watching 17 file(s) for changes
dotnet watch ⌚ Target process is 'C:\Users\user\Desktop\BlazorApp\bin\Debug\net9.0\BlazorApp.exe'
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:49847,ws://localhost:49848.
dotnet watch 🔥 HotReloadProfile: Default.
dotnet watch ⌚ [BlazorApp (net9.0)] Waiting for application to connect to pipe 1227e168-c015-4086-ad13-e7486a212322.
dotnet watch 🚀 [BlazorApp (net9.0)] Launched 'C:\Program Files\dotnet\dotnet.exe' with arguments '[env:DOTNET_MODIFIABLE_ASSEMBLIES=debug] [env:DOTNET_WATCH_HOTRELOAD_NAMEDPIPE_NAME=1227e168-c015-4086-ad13-e7486a212322] "[env:DOTNET_STARTUP_HOOKS=C:\Program Files\dotnet\sdk\9.0.100-rc.1.24452.12\DotnetTools\dotnet-watch\9.0.100-rc.1.24452.12\tools\net9.0\any\hotreload\Microsoft.Extensions.DotNetDeltaApplier.dll;C:\Program Files\dotnet\sdk\9.0.100-rc.1.24452.12\DotnetTools\dotnet-watch\9.0.100-rc.1.24452.12\tools\net9.0\any\middleware\Microsoft.AspNetCore.Watch.BrowserRefresh.dll]" run': process id 6980
Building...
dotnet watch 🕵️ [1227e168-c015-4086-ad13-e7486a212322] Loaded into process: C:\Users\user\Desktop\BlazorA
pp\bin\Debug\net9.0\BlazorApp.dll
dotnet watch 🕵️ [1227e168-c015-4086-ad13-e7486a212322] Connecting to hot-reload server
dotnet watch 🕵️ [1227e168-c015-4086-ad13-e7486a212322] Connected.
dotnet watch 🕵️ [1227e168-c015-4086-ad13-e7486a212322] Writing capabilities: Baseline AddMethodToExistingType AddStatic
FieldToExistingType AddInstanceFieldToExistingType NewTypeDefinition ChangeCustomAttributes UpdateParameters GenericUpdateMethod GenericAddMethodToExistingType GenericAddFieldToExistingType
dotnet watch ⌚ [BlazorApp (net9.0)] Capabilities: 'Baseline AddMethodToExistingType AddStaticFieldToExistingType AddInstanceFieldToExistingType NewTypeDefinition ChangeCustomAttributes UpdateParameters GenericUpdateMethod GenericAddMethodToExistingType GenericAddFieldToExistingType'
dotnet watch ⌚ [BlazorApp (net9.0)] Build completed.
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5146
dotnet watch ⌚ Launching browser: http://localhost:5146/
dotnet watch ⌚ Solution:
dotnet watch ⌚ Project: C:\Users\user\Desktop\BlazorApp\BlazorApp.csproj 121a9d8c-bbad-48cb-8e15-32f51343da86
dotnet watch ⌚ Document: C:\Users\user\Desktop\BlazorApp\Program.cs 7fc6d014-3575-4efb-9580-2ecec05275ec DE-5D-96-B9-65-0D-B2-FB-EA-5B-3D-06-18-10-EE-0D-6B-A3-23-B4-A0-1A-13-3D-EF-94-03-7B-D9-19-CD-09
dotnet watch ⌚ Document: C:\Users\user\Desktop\BlazorApp\obj\Debug\net9.0\BlazorApp.GlobalUsings.g.cs 42fb68be-ec40-4a98-8ec8-10786528b759 1B-C1-69-10-37-C2-95-25-F4-B1-04-FE-05-A7-7B-BE-F0-40-A2-7C-CE-2A-B7-84-ED-28-22-6F-8C-8B-5E-35
dotnet watch ⌚ Document: C:\Users\user\Desktop\BlazorApp\obj\Debug\net9.0.NETCoreApp,Version=v9.0.AssemblyAttributes.cs c59582d9-8d8e-497e-827b-4fb9f7ecd378 9E-76-49-9C-4E-5C-B6-23-AD-48-89-EA-A9-9B-1A-53-D9-C9-70-EF-CF-90-2D-8B-09-6E-78-A1-9E-E4-28-5D
dotnet watch ⌚ Document: C:\Users\user\Desktop\BlazorApp\obj\Debug\net9.0\BlazorApp.AssemblyInfo.cs 88e4383a-b805-4cf6-a992-ed1de4829f8c E9-A1-E4-77-8D-D3-56-EC-01-56-4D-28-A9-DC-12-B2-87-2F-EC-E5-76-E2-92-6E-F9-D9-0E-60-C8-AF-3C-9F
dotnet watch 🔥 Hot reload session started.
dotnet watch ⌚ Waiting for changes
dotnet watch ⌚ File changed: .\Components\Pages\Home.razor
dotnet watch ⌚ No hot reload changes to apply.
dotnet watch ⌚ Updating diagnostics in the browser.
dotnet watch 🔥 Hot reload change handled in 57ms.
dotnet watch ⌚ File changed: .\Components\Pages\Home.razor
dotnet watch 🔥 Hot reload capabilities: Baseline AddMethodToExistingType AddStaticFieldToExistingType AddInstanceFieldToExistingType NewTypeDefinition ChangeCustomAttributes UpdateParameters GenericUpdateMethod GenericAddMethodToExistingType GenericAddFieldToExistingType.
dotnet watch ⌚ Updating diagnostics in the browser.
dotnet watch 🔥 [BlazorApp (net9.0)] Updates applied: 1 out of 1.
dotnet watch 🔥 [BlazorApp (net9.0)] Hot reload succeeded.
dotnet watch ⌚ [BlazorApp (net9.0)] Refreshing browser.
dotnet watch 🔥 Hot reload change handled in 3819ms.

@tmat
Copy link
Member

tmat commented Sep 19, 2024

Might be the same issue as https://github.com/dotnet/AspNetCore-ManualTests/issues/3080, which was fixed by dotnet/roslyn#75029

@tmat
Copy link
Member

tmat commented Sep 19, 2024

Can you repro in the latest daily build?

@danroth27
Copy link
Member Author

Can you repro in the latest daily build?

Nope, doesn't repro with 9.0.100-rc.2.24468.2 🎉

@tmat
Copy link
Member

tmat commented Sep 19, 2024

Ok to close the issue?

@tmat tmat closed this as completed Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI feature-dotnetwatch This issue is related to the dotnet-watch command-line tool (now external)
Projects
None yet
Development

No branches or pull requests

2 participants