Skip to content

Commit

Permalink
Fix VS Code launcher and tasks for dotnet watch (#10881)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skrypt authored Mar 8, 2022
1 parent 39578e9 commit 275ce1e
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 59 deletions.
52 changes: 17 additions & 35 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -50,46 +50,28 @@
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
},
{
"name": ".NET Core Launch (publish framework dependent) - net6.0",
"type": "coreclr",
"name": ".NET Core Launch (web debug) - dotnet watch - net6.0",
"type": "dotnetwatchattach",
"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"
"task": "dotnet watch - net6.0",
"program": "OrchardCore.Cms.Web.exe",
"args": {
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web",
"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+)"
}
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
},
{
"name": "Gulp Debug",
Expand Down
87 changes: 63 additions & 24 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,43 @@
},
"tasks": [
{
"label": "Dotnet Restore",
"label": "dotnet watch - net6.0",
"type": "process",
"command": "dotnet",
"args": [
"watch",
"run",
"${workspaceRoot}/src/OrchardCore.Cms.Web",
"-f",
"net6.0"
],
"options": {
"cwd": "${workspaceRoot}/src/OrchardCore.Cms.Web"
},
"problemMatcher": "$msCompile"
},
{
"label": "dotnet run",
"type": "shell",
"command": "dotnet",
"args": [
"run",
"--project",
"${workspaceRoot}\\src\\OrchardCore.Cms.Web\\OrchardCore.Cms.Web.csproj",
"-f",
"net6.0"
]
},
{
"label": "dotnet restore",
"type": "shell",
"command": "dotnet",
"args": [
"restore"
]
},
{
"label": "Dotnet Restore Force",
"label": "dotnet restore force",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -41,7 +69,7 @@
]
},
{
"label": "Dotnet clean (debug)",
"label": "dotnet clean (debug)",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -51,7 +79,7 @@
]
},
{
"label": "Dotnet clean (release)",
"label": "dotnet clean (release)",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -61,7 +89,7 @@
]
},
{
"label": "Web App: Dotnet Build Debug - net6.0",
"label": "dotnet build (debug) - net6.0",
"type": "shell",
"command": "dotnet",
"args": [
Expand All @@ -75,42 +103,51 @@
"problemMatcher": "$msCompile"
},
{
"label": "Web App: Dotnet Rebuild Debug - net6.0",
"label": "dotnet build (release) - net6.0",
"type": "shell",
"command": "dotnet",
"args": [
"build",
"${workspaceRoot}/src/OrchardCore.Cms.Web",
"--no-incremental",
"-c",
"Debug",
"Release",
"-f",
"net6.0"
],
"problemMatcher": "$msCompile"
},
{
"label": "Web App: Dotnet Build Release - net6.0",
"label": "dotnet rebuild (debug) - net6.0",
"type": "shell",
"command": "dotnet",
"args": [
"build",
"${workspaceRoot}/src/OrchardCore.Cms.Web",
"--no-incremental",
"-c",
"Release",
"Debug",
"-f",
"net6.0"
],
"problemMatcher": "$msCompile"
},
{
"label": "Web App: Dotnet Run",
"label": "dotnet rebuild (release) - net6.0",
"type": "shell",
"command": "dotnet",
"args": [
"cd ${workspaceRoot}/src/OrchardCore.Cms.Web & dotnet run"
]
"build",
"${workspaceRoot}/src/OrchardCore.Cms.Web",
"--no-incremental",
"-c",
"Release",
"-f",
"net6.0"
],
"problemMatcher": "$msCompile"
},
{
"label": "Cleanup build folder",
"label": "cleanup publish folder",
"type": "shell",
"command": "rm",
"windows": {
Expand All @@ -126,7 +163,7 @@
]
},
{
"label": "Dotnet Publish (self-contained) - net6.0",
"label": "dotnet publish (self-contained) - release - net6.0",
"type": "shell",
"command": "dotnet",
"windows": {
Expand Down Expand Up @@ -161,7 +198,7 @@
"problemMatcher": "$msCompile"
},
{
"label": "Dotnet Publish (framework dependent) - net6.0",
"label": "dotnet publish (framework dependent) - release - net6.0",
"type": "shell",
"command": "dotnet",
"windows": {
Expand Down Expand Up @@ -198,23 +235,25 @@
"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 publish 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 publish folder",
"dotnet publish (framework dependent) - net6.0"
]
},
{
"label": "Gulp Build",
"label": "gulp build",
"type": "shell",
"command": "gulp",
"args": [
"gulp build"
"build"
],
"problemMatcher": "$gulp-tsc"
}
Expand Down

0 comments on commit 275ce1e

Please sign in to comment.