我有一个如下所述的多项目解决方案。
我无法为VSCode中的任何Web项目(尤其是Platform.Web.Admin项目)调试TypeScript。
注意:已安装Chrome调试器扩展程序,并且C#调试正常。
我已经在launch.json文件中为服务器端和chrome启动设置创建了一个复合配置。但是我仍然只能调试C#代码。
"compounds": [{
"name": "Admin Launch",
"configurations": [
"Serverside",
"Browser"
]}],{
"name": "Serverside",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Platform.Web.Admin/bin/Debug/netcoreapp2.1/Platform.Web.Admin.dll",
"args": [],
"cwd": "${workspaceFolder}/Platform.Web.Admin",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": "Browser",
"type": "chrome",
"request": "launch",
"url": "http://localhost:1981",
"webRoot": "${workspaceRoot}/wwwroot",
"breakOnLoad": true,
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:\\*": "${workspaceFolder}/*"
}
}
]
}
Platform.Web.Admin
有趣的是,如果我直接在Chrome中设置断点,则将触发VSCode中的调试模式,然后可以逐步执行TypeScript代码。
但是,如果我在VSCode中设置一个断点,它将永远不会被解决,也不会被击中。