作为.NET Core 2.0项目的一部分,我正在启动.dll,然后启动Chrome以通过Debugger for Chrome扩展程序调试前端。
如果我这样手动启动:
{
"name": "[Development] Launch Server",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.0/Website.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
"env": {
"ASPNETCORE_ENVIRONMENT": "LocalDevelopment"
},
"sourceFileMap": {
"/Views": "${workspaceRoot}/Views"
}
}
然后
{
"name": "[Development] Debug Browser",
"type": "chrome",
"request": "launch",
"url": "http://localhost:5000/home",
"port": 9222,
"webRoot": "${workspaceRoot}",
"sourceMapPathOverrides": {
"webpack:///./*": "${workspaceRoot}\\*"
}
}
一切都很好。但是,这是一个缓慢的过程,因为“启动服务器”配置需要几分钟才能构建/发布,然后我必须手动启动“调试浏览器”。
理想情况下,我会有一个“一键”解决方案来处理第一个配置,并在发布时启动第二个配置。
我试过了:
"compounds": [
{
"name": "[Development] Launch Server & Debug Browser",
"configurations": [
"[Development] Launch Server",
"[Development] Debug Browser"
]
}
]
虽然第二种配置似乎永远不会被解雇。我已经研究过tasks.json,但我不确定这是我想要完成的事情的正确位置。
我怎么能把它变成火而忘记?