Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (TestSite)",
"type": "coreclr",
"request": "launch",
"program": "dotnet",
"args": ["run"],
"cwd": "${workspaceFolder}/examples/Umbraco.Community.BlockPreview.TestSite",
Comment on lines +8 to +10
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The launch configuration uses "program": "dotnet" with "args": ["run"], which will work since the cwd is set to the project directory. However, the standard and more reliable approach for .NET debugging in VS Code is to point the program field directly to the compiled DLL:
"program": "${workspaceFolder}/examples/Umbraco.Community.BlockPreview.TestSite/bin/Debug/net10.0/Umbraco.Community.BlockPreview.TestSite.dll"

This approach:

  1. Provides better debugging performance (no additional dotnet CLI overhead)
  2. Makes it clearer what's being debugged
  3. Follows VS Code .NET extension conventions

If using this approach, remove the args field and add a preLaunchTask to build first.

Suggested change
"program": "dotnet",
"args": ["run"],
"cwd": "${workspaceFolder}/examples/Umbraco.Community.BlockPreview.TestSite",
"program": "${workspaceFolder}/examples/Umbraco.Community.BlockPreview.TestSite/bin/Debug/net10.0/Umbraco.Community.BlockPreview.TestSite.dll",
"cwd": "${workspaceFolder}/examples/Umbraco.Community.BlockPreview.TestSite",
"preLaunchTask": "build-test-site",

Copilot uses AI. Check for mistakes.
"stopAtEntry": false,
"requireExactSource": false,
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The launch configuration is missing a preLaunchTask to build the project before debugging. Add a preLaunchTask field that references the "Dotnet build" task to ensure the project is built before launching the debugger. Without this, debugging may fail if the project hasn't been built yet or if changes have been made since the last build.

Suggested change
"requireExactSource": false,
"requireExactSource": false,
"preLaunchTask": "Dotnet build",

Copilot uses AI. Check for mistakes.
"postDebugTask": "kill-test-site",
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a "console" field to specify where console output should be displayed. For web applications, the recommended value is "internalConsole" to show output in VS Code's Debug Console. Add:
"console": "internalConsole"

This provides a better debugging experience for ASP.NET Core applications.

Suggested change
}
},
"console": "internalConsole"

Copilot uses AI. Check for mistakes.
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"dotnet.defaultSolution": "src/Umbraco.Community.BlockPreview.sln"
"dotnet.defaultSolution": "Umbraco.Community.BlockPreview.sln"
}
87 changes: 87 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"detail": "Builds the client and solution",
"promptOnClose": true,
"group": "build",
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The composite "Build" task should be marked as the default build task. Change line 8 from "group": "build" to "group": {"kind": "build", "isDefault": true} to make it the default build task that can be executed with Ctrl+Shift+B (or Cmd+Shift+B on macOS).

Suggested change
"group": "build",
"group": { "kind": "build", "isDefault": true },

Copilot uses AI. Check for mistakes.
"dependsOn": ["Client Build", "Dotnet build"],
"problemMatcher": []
},
{
"label": "Client Install",
"detail": "Install npm packages for BlockPreview.UI",
"promptOnClose": true,
"type": "npm",
"script": "install",
"path": "src/Umbraco.Community.BlockPreview.UI/",
"problemMatcher": []
},
{
"label": "Client Build",
"detail": "Runs npm run build for BlockPreview.UI",
"promptOnClose": true,
"group": "build",
"type": "npm",
"script": "build",
"path": "src/Umbraco.Community.BlockPreview.UI/",
"problemMatcher": []
},
Comment on lines +21 to +30
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Client Build" task may fail if npm packages haven't been installed yet. Consider adding "Client Install" as a dependency of "Client Build" by adding a "dependsOn" field:
"dependsOn": ["Client Install"]

This ensures packages are installed before attempting to build. Alternatively, document that "Client Install" needs to be run manually before the first build.

Copilot uses AI. Check for mistakes.
{
"label": "Client Watch",
"detail": "Runs npm run dev for BlockPreview.UI",
"promptOnClose": true,
"group": "build",
"type": "npm",
"script": "dev",
"path": "src/Umbraco.Community.BlockPreview.UI/",
"problemMatcher": []
},
{
"label": "Dotnet build",
"detail": "Dotnet build of solution",
"promptOnClose": true,
"group": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Umbraco.Community.BlockPreview.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "Dotnet watch",
"detail": "Dotnet run and watch of TestSite",
"promptOnClose": true,
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/examples/Umbraco.Community.BlockPreview.TestSite/Umbraco.Community.BlockPreview.TestSite.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
Comment on lines +42 to +71
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Task naming is inconsistent. Tasks use "Client" as a prefix (e.g., "Client Build", "Client Install", "Client Watch") but then use "Dotnet" with a lowercase "n". For consistency, consider either:

  • Using "Dotnet Build" and "Dotnet Watch" (current style)
  • Using ".NET Build" and ".NET Watch" (matching the official product name)
  • Using "Server Build" and "Server Watch" (parallel to "Client")

The most common convention in VS Code configurations is to use ".NET" to match Microsoft's official branding.

Copilot uses AI. Check for mistakes.
{
"label": "kill-test-site",
"type": "shell",
"problemMatcher": [],
"osx": {
"command": "pkill -f Umbraco.Community.BlockPreview.TestSite"
},
"linux": {
"command": "pkill -f Umbraco.Community.BlockPreview.TestSite"
},
"windows": {
"command": "taskkill /IM Umbraco.Community.BlockPreview.TestSite.exe /F"
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows taskkill command is likely incorrect. When running dotnet run or debugging through VS Code, the process name is "dotnet.exe", not "Umbraco.Community.BlockPreview.TestSite.exe". The command should be:
"command": "taskkill /IM dotnet.exe /F"

However, this has the downside of killing ALL dotnet.exe processes. A more precise approach would use PowerShell to filter by working directory or command line arguments. The pkill commands on Linux/macOS also have the same issue - they may kill other instances of the application if multiple are running.

Suggested change
"command": "taskkill /IM Umbraco.Community.BlockPreview.TestSite.exe /F"
"command": "powershell -NoProfile -Command \"Get-CimInstance Win32_Process | Where-Object { $_.Name -eq 'dotnet.exe' -and $_.CommandLine -match 'Umbraco.Community.BlockPreview.TestSite' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }\""

Copilot uses AI. Check for mistakes.
Comment on lines +77 to +83
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kill-test-site task should include error handling to prevent failures when the process isn't running. Add "ignoreExitCode": true to the problemMatcher configuration or modify the commands to ignore errors:

  • Windows: "command": "taskkill /IM Umbraco.Community.BlockPreview.TestSite.exe /F || exit 0"
  • Linux/macOS: "command": "pkill -f Umbraco.Community.BlockPreview.TestSite || true"

This prevents the postDebugTask from failing when the process has already terminated, which would show an error message to the user unnecessarily.

Suggested change
"command": "pkill -f Umbraco.Community.BlockPreview.TestSite"
},
"linux": {
"command": "pkill -f Umbraco.Community.BlockPreview.TestSite"
},
"windows": {
"command": "taskkill /IM Umbraco.Community.BlockPreview.TestSite.exe /F"
"command": "pkill -f Umbraco.Community.BlockPreview.TestSite || true"
},
"linux": {
"command": "pkill -f Umbraco.Community.BlockPreview.TestSite || true"
},
"windows": {
"command": "taskkill /IM Umbraco.Community.BlockPreview.TestSite.exe /F || exit 0"

Copilot uses AI. Check for mistakes.
}
}
]
}