Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor Web App not hot reloading in Visual Studio

$
0
0

I created a new Blazor Web App (very important as WASM does work). I have the "Hot Reload" checkbox checked:

enter image description here

When I start it up, it starts up like this:

info: Microsoft.Hosting.Lifetime[14]      Now listening on: https://localhost:7106info: Microsoft.Hosting.Lifetime[14]      Now listening on: http://localhost:5175info: Microsoft.Hosting.Lifetime[0]      Application started. Press Ctrl+C to shut down.info: Microsoft.Hosting.Lifetime[0]      Hosting environment: Developmentinfo: Microsoft.Hosting.Lifetime[0]      Content root path: C:\Users\xxx\source\repos\BlazorApp4\BlazorApp4

Which doesn't say anything about hot reloading. I can debug, but if I edit something as simple as the HTML, it doesn't update automatically:

enter image description here

enter image description here

But if I run it with dotnet watch run, it works, but I can't debug it.

It starts up this way, letting me know that "Hot Reload" is enabled.

$ dotnet watch rundotnet 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 C:\Users\xxx\source\repos\BlazorApp4\BlazorApp4\BlazorApp4.csproj ...dotnet watch 🔨 Build succeeded: C:\Users\xxx\source\repos\BlazorApp4\BlazorApp4\BlazorApp4.csprojUsing launch settings from C:\Users\xxx\source\repos\BlazorApp4\BlazorApp4\Properties\launchSettings.json...info: Microsoft.Hosting.Lifetime[14]      Now listening on: http://localhost:5175info: Microsoft.Hosting.Lifetime[0]      Application started. Press Ctrl+C to shut down.info: Microsoft.Hosting.Lifetime[0]      Hosting environment: Developmentinfo: Microsoft.Hosting.Lifetime[0]      Content root path: C:\Users\xxx\source\repos\BlazorApp4\BlazorApp4warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]      Failed to determine the https port for redirect.dotnet watch ⌚ File updated: .\Components\Pages\Counter.razordotnet watch 🔥 [BlazorApp4 (net8.0)] Hot reload succeeded.dotnet watch ⌚ File updated: .\Components\Pages\Counter.razordotnet watch 🔥 [BlazorApp4 (net8.0)] Hot reload succeeded.dotnet watch 🛑 Shutdown requested. Press Ctrl+C again to force exit.info: Microsoft.Hosting.Lifetime[0]

I can then attach a debugger and it'll run the way I want it to. Why won't Visual Studio launch this with "Hot Reload"?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>