'Visual Studio Code .NET and React start and debug
I need help to set up an existing WebApp project (.NET 3.1, React) in Visual Studio Code. The problem is that this project was setup in Windows dev environment (Visual Studio) but I only use MacOS so I have to use Visual Studio Code. Debugging a .NET application works fine, but I cannot debug React code and after start, app is opened in Safari instead of Chrome. I also installed live server extension and set Chrome as default option but with no luck. Please help.
My launch.json file:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/XXXProject/bin/Debug/netcoreapp3.1/XXXProject.dll",
"args": [],
"cwd": "${workspaceFolder}/XXXProject",
"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"
}
]
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
