作为 .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,但我不确定这是我想要完成的正确位置。
我怎样才能把它变成火而忘记呢?