There’s a good chance if you are working on the SPA (Angular/React/VUE) and a back end like ASP.NET Core site. How do you get both these to run at the same time in debug mode.
Here’s a easy way.
In your .vscode folder let’s add a launch.json file
Create two nodes.
compounds
configurations
Under Configurations add these and change the folder locations:
"configurations": [
{
"name": ".NET Core Start",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/WebApi/bin/Debug/net8.0/WebApi.dll",
"args": [],
"cwd": "${workspaceFolder}/WebApi",
"stopAtEntry": false,
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
{
"name": "Launch Chrome",
"request": "launch",
"type": "msedge",
"webRoot": "${workspaceFolder}/WebApi/ClientApp",
"sourceMaps": true,
"url": "https://localhost:5001"
}
]
Now, add this for the compounds
{
"name": ".Net+Browser",
"configurations": ["Launch Chrome", ".NET Core Start"]
}
When you press F5 to run the configuration, you can choose “.Net+Browser”
In the run handler, you’ll both your configurations!