Stop Visual Studio from launching a new browser window when starting debug?

137,115

Solution 1

Open your startup project's properties (Project → {ProjectName} Properties... from the main menu or right click your project in the Solution Explorer and choose Properties), then navigate to the Web tab and under Start Action choose Don't open a page. Wait for a request from an external application.

You will still be able to use any browser (or Fiddler, whatever) to access the running application, but it won't open the browser window automatically, it'll just start in the background and wait for any requests.

Solution 2

For VS 15.7.1 ToolsOptionsProjects and SolutionsWeb Projects → uncheck Stop debugger when browser window is closed.

Solution 3

Updated answer for a .NET Core Web Api project...

Right-click on your project, select "Properties," go to "Debug" and untick the "Launch browser" checkbox (enabled by default).

enter image description here

Solution 4

In an ASP.Net 5 project this can now be set for each launch profile.

Open the file launchsettings.json under the Startup Project Properties folder and add "launchBrowser": false to the profile you are configuring, such as in:

"profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": false,
      "environmentVariables": {
        "Hosting:Environment": "Development"
      }
    }
}

Solution 5

I have solved my problem by following below steps. Go to Tools >> Click on options >> click on projects and solutions >> web projects >> uncheck "Stop debugging when browser is closed" optionenter image description here

Share:
137,115
user977601
Author by

user977601

nil

Updated on June 04, 2021

Comments

  • user977601
    user977601 almost 3 years

    I already have a window open with the web site I'm debugging. I don't need VS to launch another one for me every time I need to debug.

    Is there a way to stop this behavior?