- VS Code v1.64.2
- .NET Core v3.1
- AngularJS v1.8.2
I am trying to use Visual Studio Code for debugging .NET Core web application which is using AngularJS. I am able to debug breakpoints placed inside .CS files once I generate .NET: Generate assets for build and debug which creates launch and tasks json files inside .vscode folder.
But the debug points placed in js files of angularJS controller and services are not hitting eventhough application is running.
Am I missing some settings to be enabled for debug js files while running .NET Core in VS Code?
//// Update Feb 15 2022 I tried with the below launch.json which attaches a Chrome browser launch with the .NET Core build + launch.
Now I am able to debug both C# and Javascript in VSCode. But only issue I am facing: its opening 2 browser instances with localhost:5000. I had to manually close 1 instance which is not attached with debugger.
Is this correct way to debug both JS & C# files which are inside .NET Core web application using AngularJS.
{
"compounds": [
{
"name": ".Net+Browser",
"configurations": [ ".NET Core Launch (web)", "Launch Chrome" ]
}
],
"configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "chrome",
"url": "http://localhost:5000",
"webRoot": "${workspaceFolder}/wwwroot",
"runtimeArgs": [
"--disable-web-security"
]
},
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"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": "${workspaceFolder}/bin/Debug/netcoreapp3.1/PROJECTNAME.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}




npm run ...command?