From 155ba282ffdae540ea8b9a4d4b76598aeb844bfc Mon Sep 17 00:00:00 2001 From: Jasmin Savard Date: Wed, 15 Dec 2021 02:20:34 -0500 Subject: [PATCH 1/6] Fix VS Code launcher and tasks for dotnet watch --- .vscode/launch.json | 46 ++----------- .vscode/tasks.json | 64 ++++++++++++------- .../OrchardCore.Cms.Web.csproj | 5 ++ 3 files changed, 51 insertions(+), 64 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 0e948929138..5ae45c3c582 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,10 +2,10 @@ "version": "0.2.0", "configurations": [ { - "name": ".NET Core Launch (console) - net6.0", + "name": ".NET Core Launch (console debug) - net6.0", "type": "coreclr", "request": "launch", - "preLaunchTask": "Web App: Dotnet Build Debug - net6.0", + "preLaunchTask": "dotnet build debug - net6.0", "program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net6.0/OrchardCore.Cms.Web.dll", "args": [], "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", @@ -19,7 +19,7 @@ "type": "coreclr", "request": "launch", "internalConsoleOptions": "openOnSessionStart", - "preLaunchTask": "Web App: Dotnet Build Debug - net6.0", + "preLaunchTask": "dotnet build debug - net6.0", "program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net6.0/OrchardCore.Cms.Web.dll", "args": [], "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", @@ -36,7 +36,7 @@ "name": ".NET Core Launch (web release) - net6.0", "type": "coreclr", "request": "launch", - "preLaunchTask": "Web App: Dotnet Build Release - net6.0", + "preLaunchTask": "dotnet build release - net6.0", "program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Release/net6.0/OrchardCore.Cms.Web.dll", "args": [], "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", @@ -53,43 +53,7 @@ "name": ".NET Core Attach", "type": "coreclr", "request": "attach", - "processId": "${command:pickProcess}" - }, - { - "name": ".NET Core Launch (publish framework dependent) - net6.0", - "type": "coreclr", - "request": "launch", - "internalConsoleOptions": "openOnSessionStart", - "preLaunchTask": "Web App: Dotnet Publish (framework dependent) - net6.0", - "program": "${workspaceRoot}/.build/release/OrchardCore.Cms.Web.dll", - "args": [], - "cwd": "${workspaceRoot}/.build/release", - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "stopAtEntry": false, - "serverReadyAction": { - "action": "openExternally", - "pattern": "\\bNow listening on:\\s+(https?://\\S+)" - } - }, - { - "name": ".NET Core Launch (publish self-contained) - net6.0", - "type": "coreclr", - "request": "launch", - "internalConsoleOptions": "openOnSessionStart", - "preLaunchTask": "Web App: Dotnet Publish (self-contained) - net6.0", - "program": "${workspaceRoot}/.build/release/OrchardCore.Cms.Web.dll", - "args": [], - "cwd": "${workspaceRoot}/.build/release", - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "stopAtEntry": false, - "serverReadyAction": { - "action": "openExternally", - "pattern": "\\bNow listening on:\\s+(https?://\\S+)" - } + "processName": "OrchardCore.Cms.Web.exe" }, { "name": "Gulp Debug", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 6c332a2dfc0..788317a1bc3 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -24,7 +24,13 @@ }, "tasks": [ { - "label": "Dotnet Restore", + "label": "dotnet run", + "args": [ + "cd ${workspaceRoot}/src/OrchardCore.Cms.Web & dotnet run" + ] + }, + { + "label": "dotnet restore", "type": "shell", "command": "dotnet", "args": [ @@ -32,7 +38,7 @@ ] }, { - "label": "Dotnet Restore Force", + "label": "dotnet restore force", "type": "shell", "command": "dotnet", "args": [ @@ -41,7 +47,7 @@ ] }, { - "label": "Dotnet clean (debug)", + "label": "dotnet clean (debug)", "type": "shell", "command": "dotnet", "args": [ @@ -51,7 +57,7 @@ ] }, { - "label": "Dotnet clean (release)", + "label": "dotnet clean (release)", "type": "shell", "command": "dotnet", "args": [ @@ -61,7 +67,25 @@ ] }, { - "label": "Web App: Dotnet Build Debug - net6.0", + "label": "dotnet watch - net6.0", + "type": "process", + "command": "dotnet", + "args": [ + "watch", + "run", + "${workspaceRoot}/src/OrchardCore.Cms.Web", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary", + "-f", + "net6.0" + ], + "problemMatcher": "$msCompile", + "options": { + "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web" + } + }, + { + "label": "dotnet build debug - net6.0", "type": "shell", "command": "dotnet", "args": [ @@ -75,7 +99,7 @@ "problemMatcher": "$msCompile" }, { - "label": "Web App: Dotnet Rebuild Debug - net6.0", + "label": "dotnet rebuild debug - net6.0", "type": "shell", "command": "dotnet", "args": [ @@ -90,7 +114,7 @@ "problemMatcher": "$msCompile" }, { - "label": "Web App: Dotnet Build Release - net6.0", + "label": "dotnet build release - net6.0", "type": "shell", "command": "dotnet", "args": [ @@ -104,13 +128,7 @@ "problemMatcher": "$msCompile" }, { - "label": "Web App: Dotnet Run", - "args": [ - "cd ${workspaceRoot}/src/OrchardCore.Cms.Web & dotnet run" - ] - }, - { - "label": "Cleanup build folder", + "label": "cleanup build folder", "type": "shell", "command": "rm", "windows": { @@ -126,7 +144,7 @@ ] }, { - "label": "Dotnet Publish (self-contained) - net6.0", + "label": "dotnet publish release (self-contained) - net6.0", "type": "shell", "command": "dotnet", "windows": { @@ -161,7 +179,7 @@ "problemMatcher": "$msCompile" }, { - "label": "Dotnet Publish (framework dependent) - net6.0", + "label": "dotnet publish release (framework dependent) - net6.0", "type": "shell", "command": "dotnet", "windows": { @@ -198,21 +216,21 @@ "problemMatcher": "$msCompile" }, { - "label": "Web App: Dotnet Publish (self-contained) - net6.0", + "label": "tasks: dotnet publish release (self-contained) - net6.0", "dependsOn": [ - "Cleanup build folder", - "Dotnet Publish (self-contained) - net6.0" + "cleanup build folder", + "dotnet publish (self-contained) - net6.0" ] }, { - "label": "Web App: Dotnet Publish (framework dependent) - net6.0", + "label": "tasks: dotnet publish release (framework dependent) - net6.0", "dependsOn": [ - "Cleanup build folder", - "Dotnet Publish (framework dependent) - net6.0" + "cleanup build folder", + "dotnet publish (framework dependent) - net6.0" ] }, { - "label": "Gulp Build", + "label": "gulp build", "args": [ "gulp build" ], diff --git a/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj b/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj index d666c6cf1a5..02ee6cc6c4a 100644 --- a/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj +++ b/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj @@ -13,6 +13,11 @@ false + + + + + From 478f8859a0aac59cb4d9be8990509a12b79b3f2e Mon Sep 17 00:00:00 2001 From: Jasmin Savard Date: Wed, 15 Dec 2021 03:26:13 -0500 Subject: [PATCH 2/6] introduce dotnet-watch-attach experimental --- .vscode/launch.json | 46 ++++----------------------------- .vscode/tasks.json | 63 +++++++++++++++++++++++++++++++-------------- 2 files changed, 48 insertions(+), 61 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 5ae45c3c582..2c465b01db3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,25 +2,12 @@ "version": "0.2.0", "configurations": [ { - "name": ".NET Core Launch (console debug) - net6.0", - "type": "coreclr", + "name": ".NET Core Launch (web debug) - dotnet watch - net6.0", + "type": "dotnetwatchattach", "request": "launch", - "preLaunchTask": "dotnet build debug - net6.0", - "program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net6.0/OrchardCore.Cms.Web.dll", - "args": [], - "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "stopAtEntry": false - }, - { - "name": ".NET Core Launch (web debug) - net6.0", - "type": "coreclr", - "request": "launch", - "internalConsoleOptions": "openOnSessionStart", - "preLaunchTask": "dotnet build debug - net6.0", - "program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net6.0/OrchardCore.Cms.Web.dll", + "preLaunchTask": "dotnet watch - net6.0", + "postDebugTask": "terminatewatch", + "program": "OrchardCore.Cms.Web.exe", "args": [], "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", "env": { @@ -32,29 +19,6 @@ "pattern": "\\bNow listening on:\\s+(https?://\\S+)" } }, - { - "name": ".NET Core Launch (web release) - net6.0", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "dotnet build release - net6.0", - "program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Release/net6.0/OrchardCore.Cms.Web.dll", - "args": [], - "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "stopAtEntry": false, - "serverReadyAction": { - "action": "openExternally", - "pattern": "\\bNow listening on:\\s+(https?://\\S+)" - } - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processName": "OrchardCore.Cms.Web.exe" - }, { "name": "Gulp Debug", "type": "node", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 788317a1bc3..324106040c5 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -22,11 +22,50 @@ } } }, + "inputs": [ + { + "id": "terminatewatchparam", + "type": "command", + "command": "workbench.action.tasks.terminate", + "args": "watch" + } + ], "tasks": [ + { + "label": "dotnet watch - net6.0", + "type": "process", + "command": "dotnet", + "args": [ + "watch", + "run", + "${workspaceRoot}/src/OrchardCore.Cms.Web", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary", + "-f", + "net6.0" + ], + "options": { + "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web" + }, + "isBackground": true, + "problemMatcher": "$msCompile" + }, + { + "label": "terminatewatch", + "type": "shell", + "command": "echo ${input:terminatewatchparam}", + "problemMatcher": [] + }, { "label": "dotnet run", + "type": "shell", + "command": "dotnet", "args": [ - "cd ${workspaceRoot}/src/OrchardCore.Cms.Web & dotnet run" + "run", + "--project", + "${workspaceRoot}\\src\\OrchardCore.Cms.Web\\OrchardCore.Cms.Web.csproj", + "-f", + "net6.0" ] }, { @@ -66,24 +105,6 @@ "Release" ] }, - { - "label": "dotnet watch - net6.0", - "type": "process", - "command": "dotnet", - "args": [ - "watch", - "run", - "${workspaceRoot}/src/OrchardCore.Cms.Web", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary", - "-f", - "net6.0" - ], - "problemMatcher": "$msCompile", - "options": { - "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web" - } - }, { "label": "dotnet build debug - net6.0", "type": "shell", @@ -231,8 +252,10 @@ }, { "label": "gulp build", + "type": "shell", + "command": "gulp", "args": [ - "gulp build" + "build" ], "problemMatcher": "$gulp-tsc" } From e8809733cdf4d483f641c99fc275bf0cb569d0b9 Mon Sep 17 00:00:00 2001 From: Jasmin Savard Date: Fri, 11 Feb 2022 03:28:38 -0500 Subject: [PATCH 3/6] Add back some usefull launchers Clean up some tasks --- .vscode/launch.json | 55 +++++++++++++++++++++++++++++++++++++++++++++ .vscode/tasks.json | 31 ++++++++++++++++++------- 2 files changed, 78 insertions(+), 8 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 2c465b01db3..fbabd98408f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,55 @@ { "version": "0.2.0", "configurations": [ + { + "name": ".NET Core Launch (console debug) - net6.0", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "Web App: Dotnet Build Debug - net6.0", + "program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net6.0/OrchardCore.Cms.Web.dll", + "args": [], + "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "stopAtEntry": false + }, + { + "name": ".NET Core Launch (web debug) - net6.0", + "type": "coreclr", + "request": "launch", + "internalConsoleOptions": "openOnSessionStart", + "preLaunchTask": "Web App: Dotnet Build Debug - net6.0", + "program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net6.0/OrchardCore.Cms.Web.dll", + "args": [], + "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", + "env": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_URLS": "https://localhost:5001;http://localhost:5000" + }, + "stopAtEntry": false, + "serverReadyAction": { + "action": "openExternally", + "pattern": "\\bNow listening on:\\s+(https?://\\S+)" + } + }, + { + "name": ".NET Core Launch (web release) - net6.0", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "Web App: Dotnet Build Release - net6.0", + "program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Release/net6.0/OrchardCore.Cms.Web.dll", + "args": [], + "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "stopAtEntry": false, + "serverReadyAction": { + "action": "openExternally", + "pattern": "\\bNow listening on:\\s+(https?://\\S+)" + } + }, { "name": ".NET Core Launch (web debug) - dotnet watch - net6.0", "type": "dotnetwatchattach", @@ -19,6 +68,12 @@ "pattern": "\\bNow listening on:\\s+(https?://\\S+)" } }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + }, { "name": "Gulp Debug", "type": "node", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 324106040c5..5eabd6f0448 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -106,7 +106,7 @@ ] }, { - "label": "dotnet build debug - net6.0", + "label": "dotnet build (debug) - net6.0", "type": "shell", "command": "dotnet", "args": [ @@ -120,7 +120,21 @@ "problemMatcher": "$msCompile" }, { - "label": "dotnet rebuild debug - net6.0", + "label": "dotnet build (release) - net6.0", + "type": "shell", + "command": "dotnet", + "args": [ + "build", + "${workspaceRoot}/src/OrchardCore.Cms.Web", + "-c", + "Release", + "-f", + "net6.0" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "dotnet rebuild (debug) - net6.0", "type": "shell", "command": "dotnet", "args": [ @@ -135,12 +149,13 @@ "problemMatcher": "$msCompile" }, { - "label": "dotnet build release - net6.0", + "label": "dotnet rebuild (release) - net6.0", "type": "shell", "command": "dotnet", "args": [ "build", "${workspaceRoot}/src/OrchardCore.Cms.Web", + "--no-incremental", "-c", "Release", "-f", @@ -149,7 +164,7 @@ "problemMatcher": "$msCompile" }, { - "label": "cleanup build folder", + "label": "cleanup publish folder", "type": "shell", "command": "rm", "windows": { @@ -165,7 +180,7 @@ ] }, { - "label": "dotnet publish release (self-contained) - net6.0", + "label": "dotnet publish (self-contained) - release - net6.0", "type": "shell", "command": "dotnet", "windows": { @@ -200,7 +215,7 @@ "problemMatcher": "$msCompile" }, { - "label": "dotnet publish release (framework dependent) - net6.0", + "label": "dotnet publish (framework dependent) - release - net6.0", "type": "shell", "command": "dotnet", "windows": { @@ -239,14 +254,14 @@ { "label": "tasks: dotnet publish release (self-contained) - net6.0", "dependsOn": [ - "cleanup build folder", + "cleanup publish folder", "dotnet publish (self-contained) - net6.0" ] }, { "label": "tasks: dotnet publish release (framework dependent) - net6.0", "dependsOn": [ - "cleanup build folder", + "cleanup publish folder", "dotnet publish (framework dependent) - net6.0" ] }, From 77e04b67d066f2fb4ec20dccb8b3cdc8073832cd Mon Sep 17 00:00:00 2001 From: Jasmin Savard Date: Fri, 11 Feb 2022 03:37:26 -0500 Subject: [PATCH 4/6] Remove urls as they are defined in the launchsetting.json file --- .vscode/launch.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index fbabd98408f..6687c8fd7dc 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -24,8 +24,7 @@ "args": [], "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", "env": { - "ASPNETCORE_ENVIRONMENT": "Development", - "ASPNETCORE_URLS": "https://localhost:5001;http://localhost:5000" + "ASPNETCORE_ENVIRONMENT": "Development" }, "stopAtEntry": false, "serverReadyAction": { From 332d040e2704bf1a9fadf852dc89847985fcad21 Mon Sep 17 00:00:00 2001 From: Jasmin Savard Date: Fri, 11 Feb 2022 14:18:58 -0500 Subject: [PATCH 5/6] Update launch.json with proper tasks names --- .vscode/launch.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 6687c8fd7dc..fe0249fe8d9 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,7 +5,7 @@ "name": ".NET Core Launch (console debug) - net6.0", "type": "coreclr", "request": "launch", - "preLaunchTask": "Web App: Dotnet Build Debug - net6.0", + "preLaunchTask": "dotnet build (debug) - net6.0", "program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net6.0/OrchardCore.Cms.Web.dll", "args": [], "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", @@ -19,7 +19,7 @@ "type": "coreclr", "request": "launch", "internalConsoleOptions": "openOnSessionStart", - "preLaunchTask": "Web App: Dotnet Build Debug - net6.0", + "preLaunchTask": "dotnet build (debug) - net6.0", "program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Debug/net6.0/OrchardCore.Cms.Web.dll", "args": [], "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", @@ -36,7 +36,7 @@ "name": ".NET Core Launch (web release) - net6.0", "type": "coreclr", "request": "launch", - "preLaunchTask": "Web App: Dotnet Build Release - net6.0", + "preLaunchTask": "dotnet build (release) - net6.0", "program": "${workspaceRoot}/src/OrchardCore.Cms.Web/bin/Release/net6.0/OrchardCore.Cms.Web.dll", "args": [], "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", From 6fdba996619790f06d9b64d4ed07c2a21a0ca19b Mon Sep 17 00:00:00 2001 From: Jasmin Savard Date: Sun, 6 Mar 2022 08:31:37 -0500 Subject: [PATCH 6/6] React to latest changes in .NET Watch Attach extension --- .vscode/launch.json | 12 ++++++------ .vscode/tasks.json | 17 ----------------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index fe0249fe8d9..b8e4600a6de 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -53,14 +53,14 @@ "name": ".NET Core Launch (web debug) - dotnet watch - net6.0", "type": "dotnetwatchattach", "request": "launch", - "preLaunchTask": "dotnet watch - net6.0", - "postDebugTask": "terminatewatch", + "task": "dotnet watch - net6.0", "program": "OrchardCore.Cms.Web.exe", - "args": [], - "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" + "args": { + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + } }, + "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web", "stopAtEntry": false, "serverReadyAction": { "action": "openExternally", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 5eabd6f0448..55d43018162 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -22,14 +22,6 @@ } } }, - "inputs": [ - { - "id": "terminatewatchparam", - "type": "command", - "command": "workbench.action.tasks.terminate", - "args": "watch" - } - ], "tasks": [ { "label": "dotnet watch - net6.0", @@ -39,23 +31,14 @@ "watch", "run", "${workspaceRoot}/src/OrchardCore.Cms.Web", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary", "-f", "net6.0" ], "options": { "cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web" }, - "isBackground": true, "problemMatcher": "$msCompile" }, - { - "label": "terminatewatch", - "type": "shell", - "command": "echo ${input:terminatewatchparam}", - "problemMatcher": [] - }, { "label": "dotnet run", "type": "shell",