How to disable browser launching on build and launch in .NET Core
I am developing web API with .NET Core on macOS with deployment on Linux. I am absolutely not interested in using the browser. However, when building and working with Visual Studio Code (debug or not), the browser is launched every time .
I need to close the tab, remove the browser from the path, go to Paw, where I am actually testing the API, and then go back to VS Code.
It's really annoying to do this every time.
Is there any configuration to disable browser startup?
thank
source to share
Short answer
Open the file .vscode/launch.json
and disconnect launchBrowser
.
More details
-
dotnet new webapi
- Open VS Code.
- Add the required assets for building and debugging.
At this point there is a directory .vscode
containing the file launch.json
. Open this file and disable or delete the following.
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
See also: https://code.visualstudio.com/docs/editor/debugging#_launch-configurations
source to share