Is there a way to set breakpoints and debug javascript and c# at the same time in VS Code (on macOS)?
I have installed the chrome debugger extension and then created a new MVC app using dotnet new mvc.
But when I launch the app breakpoint are only hit in the C# files, they stay grayed out in the js files (site.js) because no symbols have been loaded.
These are my launch settings (the only thing I have modified is osx command because chrome is not my default browser on macOS):
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.1/Foo.PhotoSite.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceRoot}/Views"
}
@bitbonk : No, there is no way to do that in VS Code. The best you can do is run two different instances of VS Code. In your first instance, remove the launchBrowser element. Start debugging that. Once debugging launches in that instance you could then F5 your chrome debugging instance.
@bitbonk i asked myself the same question. I asked here on Stackoverflow and gave myself the answer after some research. I don't know if this will work on mac, but give it a try.
Most helpful comment
@bitbonk i asked myself the same question. I asked here on Stackoverflow and gave myself the answer after some research. I don't know if this will work on mac, but give it a try.