Reputation: 720
I'm working on a project that has a C# backend but the frontend is in React and Javascript. Debugging the C# works fine. When I try to debug the Javascript, it says 'No symbols have been loaded for this document'. Note that this is in Visual Studio Code not Visual Studio.
It's a huge project, so I'd like to place breakpoints and debug the code in Visual Studio Code rather than in Chrome tools.
Upvotes: 3
Views: 3145
Reputation: 720
I installed the 'Debugger for Chrome' VS Code extension, then I set my launch.json to be this:
{
"version": "0.2.0",
"configurations": [
{
"name": "WebApp Chrome Debug",
"type": "chrome",
"request": "launch",
"url": "http://localhost:5000",
"webRoot": "${workspaceFolder}/Bob/WebApp",
"sourceMapPathOverrides": {
"/*": "/__vscode-remote-uri__/*",
}
},
{
"name": "Launch WebApp (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Bob/WebApp/bin/Debug/WebApp.dll",
"args": [],
"cwd": "${workspaceFolder}/Bob/WebApp",
"console": "externalTerminal",
"internalConsoleOptions": "openOnSessionStart",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
}
}
]
}
First I debug using the Launch WebApp (console) configuration:
Once that's launched, I run the 'WebApp Chrome Debug' configuration the same way:
Debugging:
Upvotes: 1