我想使用Debugger for Chrome的“附加” 选项而不是每次打开新浏览器窗口的“启动”选项来调试AngularJS / Typescript网站。
这是为Debugger for Chrome创建的launch.json文件:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "attach",
"name": "Attach to Chrome",
"port": 9222,
"webRoot": "${workspaceFolder}"
},
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
我通过传递--remote-debugging-port=9222
参数来启动Chrome:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
我使用服务托管应用:服务-l 8080
但是我无法使调试器正常工作,断点也没有命中,并且VSCode似乎无法附加。
我错过了什么吗?谢谢。