Hot reload as a third launch mode, rewritten from dotnet-hot-reload

dotnet watch run with the startup project, configuration, platform and
per-project launch options from the status bar. The debugger is no
longer attached automatically: attach on demand, one notification with
Re-attach when the watcher replaces the process. Rude edits follow a
setting (restart / ask / warn). Warns before starting under an optimised
configuration, which SDK 10's dotnet watch cannot hot reload. Solution
build runs first so the Editor's post-build step finds the Builder.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169iPWwKHZoBTNN9qwXiwqk
This commit is contained in:
max
2026-09-08 13:47:37 +02:00
co-authored by Claude Fable 5.1
parent 63de8a31f6
commit 0cae24a1f0
10 changed files with 1164 additions and 9 deletions
+121 -2
View File
@@ -1,7 +1,7 @@
{
"name": "dotnet-solution-launcher",
"displayName": ".NET Solution Launcher",
"description": "Startup project and solution configuration (Debug|x64, Test|x64, ...) in the status bar, with build and debug that honour them. Made for DotRush, which shows the configuration but not the project and never passes the platform.",
"description": "Startup project and solution configuration (Debug|x64, Test|x64, ...) in the status bar, with build, debug, run and hot reload that honour them. Made for DotRush, which shows the configuration but not the project and never passes the platform.",
"version": "0.1.0",
"publisher": "local",
"license": "MIT",
@@ -18,7 +18,9 @@
"solution",
"configuration",
"dotrush",
"startup project"
"startup project",
"hot reload",
"dotnet watch"
],
"activationEvents": [
"onLanguage:csharp",
@@ -83,6 +85,50 @@
"category": ".NET Solution",
"icon": "$(play)"
},
{
"command": "dotnetSolution.hotReload.start",
"title": "Run Startup Project with Hot Reload",
"category": ".NET Solution",
"icon": "$(flame)"
},
{
"command": "dotnetSolution.hotReload.apply",
"title": "Hot Reload: Apply Changes",
"category": ".NET Solution",
"icon": "$(flame)"
},
{
"command": "dotnetSolution.hotReload.restart",
"title": "Hot Reload: Restart Application",
"category": ".NET Solution",
"icon": "$(debug-restart)"
},
{
"command": "dotnetSolution.hotReload.stop",
"title": "Hot Reload: Stop",
"category": ".NET Solution",
"icon": "$(debug-stop)"
},
{
"command": "dotnetSolution.hotReload.attach",
"title": "Hot Reload: Attach Debugger",
"category": ".NET Solution"
},
{
"command": "dotnetSolution.hotReload.detach",
"title": "Hot Reload: Detach Debugger",
"category": ".NET Solution"
},
{
"command": "dotnetSolution.hotReload.showTerminal",
"title": "Hot Reload: Show Terminal",
"category": ".NET Solution"
},
{
"command": "dotnetSolution.hotReload.menu",
"title": "Hot Reload: Actions",
"category": ".NET Solution"
},
{
"command": "dotnetSolution.generateLaunchConfig",
"title": "Create launch.json and tasks.json entries",
@@ -116,6 +162,46 @@
{
"command": "dotnetSolution.setStartupProject",
"when": "false"
},
{
"command": "dotnetSolution.hotReload.apply",
"when": "dotnetSolution.hotReload.running"
},
{
"command": "dotnetSolution.hotReload.restart",
"when": "dotnetSolution.hotReload.running"
},
{
"command": "dotnetSolution.hotReload.stop",
"when": "dotnetSolution.hotReload.running"
},
{
"command": "dotnetSolution.hotReload.attach",
"when": "dotnetSolution.hotReload.running && !dotnetSolution.hotReload.attached"
},
{
"command": "dotnetSolution.hotReload.detach",
"when": "dotnetSolution.hotReload.attached"
},
{
"command": "dotnetSolution.hotReload.showTerminal",
"when": "dotnetSolution.hotReload.running"
},
{
"command": "dotnetSolution.hotReload.menu",
"when": "false"
}
],
"debug/toolBar": [
{
"command": "dotnetSolution.hotReload.apply",
"when": "dotnetSolution.hotReload.attached",
"group": "navigation@10"
},
{
"command": "dotnetSolution.hotReload.restart",
"when": "dotnetSolution.hotReload.attached",
"group": "navigation@11"
}
]
},
@@ -301,6 +387,34 @@
"type": "boolean",
"default": true,
"description": "Open the Problems panel when a build, publish or test run fails."
},
"dotnetSolution.hotReload.rudeEdit": {
"type": "string",
"enum": [
"restart",
"ask",
"warn"
],
"default": "restart",
"enumDescriptions": [
"Restart the application automatically (DOTNET_WATCH_RESTART_ON_RUDE_EDIT).",
"Show a prompt with Restart / Keep running.",
"Keep running the old code and show a warning with a Restart button."
],
"description": "What happens when an edit cannot be hot reloaded (a rude edit)."
},
"dotnetSolution.hotReload.buildSolutionFirst": {
"type": "boolean",
"default": true,
"markdownDescription": "Run the solution build before starting `dotnet watch`. dotnet watch builds only the startup project, so solution-level dependencies (the Editor's post-build step needs the Builder) would otherwise be missing on a clean checkout."
},
"dotnetSolution.hotReload.watchArgs": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Extra arguments for dotnet watch itself, e.g. [\"--verbose\"]."
}
}
},
@@ -330,6 +444,11 @@
"command": "dotnetSolution.selectStartupProject",
"key": "ctrl+alt+p",
"when": "dotnetSolution.active"
},
{
"command": "dotnetSolution.hotReload.start",
"key": "ctrl+alt+f5",
"when": "dotnetSolution.active && !dotnetSolution.hotReload.running"
}
]
},