How to disable browser launch when building and running in .NET Core

It is changed in version 0.2.0.

Just comment out the below lines.

// "serverReadyAction": {
//     "action": "openExternally",
//     "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"
// },

Short Answer

Open the .vscode/launch.json file and disable launchBrowser.

More Details

  1. dotnet new webapi
  2. Open VS Code.
  3. Add required assets to build and debug.

At this point, there is a .vscode directory that contains a launch.json file. Open that 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