Skip to content

Commit 49bd296

Browse files
committed
Debugging Config
Allows both VS Code launched Vue-Cli server and internal .NET Core Launch.
1 parent aa0beb8 commit 49bd296

File tree

3 files changed

+107
-31
lines changed

3 files changed

+107
-31
lines changed

.vscode/launch.json

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,65 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8-
"name": ".NET Core Launch (web)",
8+
"name": ".NET Core & Vue Server",
99
"type": "coreclr",
1010
"request": "launch",
11-
"preLaunchTask": "build",
11+
"logging": {
12+
"moduleLoad": false
13+
},
14+
"env": {
15+
"ASPNETCORE_ENVIRONMENT": "Development",
16+
"VUE_DEV_SERVER_PROGRESS": "true"
17+
},
18+
"cwd": "${workspaceFolder}",
19+
"preLaunchTask": "build-vue-cli-serve",
1220
// If you have changed target frameworks, make sure to update the program path.
1321
"program": "${workspaceFolder}/bin/Debug/net5.0/AspNetCoreVueStarter.dll",
14-
"args": [],
15-
"cwd": "${workspaceFolder}",
16-
// this will kill any stray vue-cli processes, as the .NET app can't shut them down when it is killed by the debugger
17-
"postDebugTask": "kill",
22+
"args": [
23+
"/mode:attach"
24+
],
1825
"stopAtEntry": false,
26+
"sourceFileMap": {
27+
"/Views": "${workspaceFolder}/Views"
28+
},
1929
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
2030
"serverReadyAction": {
21-
"action": "openExternally",
22-
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
31+
"action": "startDebugging",
32+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
33+
"name": "Chrome Browser"
34+
},
35+
// this will kill any stray vue-cli processes, as the .NET app can't shut them down when it is killed by the debugger
36+
"postDebugTask": "kill"
37+
},
38+
{
39+
"name": ".NET Core Web",
40+
"type": "coreclr",
41+
"request": "launch",
42+
"logging": {
43+
"moduleLoad": false
2344
},
2445
"env": {
2546
"ASPNETCORE_ENVIRONMENT": "Development"
2647
},
48+
"cwd": "${workspaceFolder}",
49+
"preLaunchTask": "build",
50+
// If you have changed target frameworks, make sure to update the program path.
51+
"program": "${workspaceFolder}/bin/Debug/net5.0/AspNetCoreVueStarter.dll",
52+
"args": [
53+
"/mode:start"
54+
],
55+
"stopAtEntry": false,
2756
"sourceFileMap": {
2857
"/Views": "${workspaceFolder}/Views"
29-
}
58+
},
59+
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
60+
"serverReadyAction": {
61+
"action": "startDebugging",
62+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
63+
"name": "Chrome Browser"
64+
},
65+
// this will kill any stray vue-cli processes, as the .NET app can't shut them down when it is killed by the debugger
66+
"postDebugTask": "kill"
3067
},
3168
{
3269
"name": ".NET Core Attach",
@@ -35,36 +72,20 @@
3572
"processId": "${command:pickProcess}"
3673
},
3774
{
38-
"name": "Launch Chrome",
75+
"name": "Chrome Browser",
3976
"type": "chrome",
4077
"request": "launch",
4178
"url": "http://localhost:5000",
42-
"webRoot": "${workspaceFolder}/ClientApp/",
79+
"webRoot": "${workspaceFolder}/ClientApp",
4380
"breakOnLoad": true,
44-
"sourceMaps": true
81+
"sourceMaps": true,
4582
},
4683
{
47-
"name": "Launch Firefox",
84+
"name": "Firefox Browser",
4885
"type": "firefox",
4986
"request": "launch",
5087
"url": "http://localhost:5000",
51-
"webRoot": "${workspaceFolder}/ClientApp/"
52-
}
53-
],
54-
"compounds": [
55-
{
56-
"name": "Debug SPA and API (Chrome)",
57-
"configurations": [
58-
".NET Core Launch (web)",
59-
"Launch Chrome"
60-
]
61-
},
62-
{
63-
"name": "Debug SPA and API (Firefox)",
64-
"configurations": [
65-
".NET Core Launch (web)",
66-
"Launch Firefox"
67-
]
88+
"webRoot": "${workspaceFolder}/ClientApp"
6889
}
6990
]
7091
}

.vscode/tasks.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,62 @@
4747
"${workspaceFolder}/bin/Debug/net5.0/AspNetCoreVueStarter.dll",
4848
"/mode:kill"
4949
],
50+
"presentation": {
51+
"echo": false,
52+
"reveal": "never",
53+
"focus": false,
54+
"panel": "shared",
55+
"showReuseMessage": true,
56+
"clear": false
57+
},
5058
"problemMatcher": []
59+
},
60+
{
61+
"label": "vue-cli-serve",
62+
"command": "npm",
63+
"type": "shell",
64+
"isBackground": true,
65+
"options": {
66+
"cwd": "${workspaceFolder}/ClientApp/",
67+
"env": {
68+
"VUE_DEV_SERVER_PROGRESS": "true"
69+
}
70+
},
71+
"args": [
72+
"run",
73+
"serve"
74+
],
75+
"presentation": {
76+
"echo": false,
77+
"reveal": "always",
78+
"focus": false,
79+
"panel": "dedicated",
80+
"showReuseMessage": false,
81+
"clear": true
82+
},
83+
"problemMatcher": [
84+
{
85+
"pattern": [
86+
{
87+
"regexp": ".",
88+
"file": 1,
89+
"location": 2,
90+
"message": 3
91+
}
92+
],
93+
"background": {
94+
"activeOnStart": true,
95+
"beginsPattern": ".",
96+
"endsPattern": "App running at",
97+
}
98+
}
99+
]
100+
},
101+
{
102+
"label": "build-vue-cli-serve",
103+
"dependsOn": ["build", "vue-cli-serve"],
104+
"dependsOrder": "sequence",
51105
}
106+
52107
]
53108
}

ClientApp/vue.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ module.exports = {
44
},
55
transpileDependencies: ['vuetify'],
66
devServer: {
7-
progress: false
7+
progress: !!process.env.VUE_DEV_SERVER_PROGRESS
88
}
99
}

0 commit comments

Comments
 (0)