I was playing with the Blazor support in the Torizon VS Code Extension. It’s lovely. I was quickly up and running able to debug on the device.
Turns out, there’s also an option to debug with the code just running in the WSL Torizon distro. Even better. (F5 to Running app is pretty fast)
But I live in 2025, and I love the “edit-and-continue” feature that modern languages and IDEs provide. In Blazor, people call it hot reload. It prevents the whole Shift + F5 to kill the app then F5 to rebuild.
Well, with a little tweaking, I now have Hot Reload for Blazor WASM working.
I added 3 new configurations and a compound to join them.
launch.json
{
"name": "Local Debug w/ Hot Reload?",
"type": "blazorwasm",
"request": "launch",
"preLaunchTask": "build-debug-local",
"program": "${workspaceFolder}/bin/Debug/net8.0/mpcambio.dll",
"cwd": "${workspaceFolder}",
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"url": "https://localhost:7001" // Tell launch where to find site
},
{
"name": "Watch",
"type": "coreclr",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "dotnet",
"args": [
"watch",
"--project",
".",
"--verbose" // Let's us confirm browser connects with hot reload capabilities
],
"preLaunchTask": "build-debug-local" // Ensure we don't watch an unbuilt site
},
{
"name": "Attach",
"type": "blazorwasm",
"request": "attach",
"cwd": "${workspaceFolder}",
"url": "https://localhost:7001", // Tell launch where to find site
"timeout": 120000, // Allows time for the site to launch
},],
"compounds": [
{
"name": "Debug with Hot Reload",
"configurations": [
"Watch",
"Attach"
]
}
]
And… it works!
Now I can edit my razor files and see my changes without breaking down and rebuilding.