启动调试时,阻止Visual Studio启动新的浏览器窗口?

本文翻译自:Stop Visual Studio from launching a new browser window when starting debug?

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. 每次我需要调试时,我都不需要VS为我启动另一个。

Is there a way to stop this behavior? 有没有办法阻止这种行为?


#1楼

参考:https://stackoom.com/question/30om/启动调试时-阻止Visual-Studio启动新的浏览器窗口


#2楼

There seems to be one case in which none of the above but the following helps. 似乎有一种情况,其中没有上述情况,但以下情况有所帮助。 I'm developing a project for Windows Azure cloud platform and I have a web role. 我正在为Windows Azure云平台开发一个项目,我有一个Web角色。 There is indeed a radio button Don't open page in Project -> {Project name} properties... as was pointed out by Pawel Krakowiak, but it has no effect in my case whatsoever. 确实有一个单选按钮不要项目 - > {项目名称}属性中 打开页面 ......正如Pawel Krakowiak所指出的那样,但它对我的情况没有任何影响。 However, there is the main cloud project in solution explorer and there is the Roles folder under it. 但是,解决方案资源管理器中有一个主要的云项目,其下有Roles文件夹。 If I right click my web role in this folder and choose Properties , I get another set of settings and on the Configuration tab there is the Launch browser for flag, after unchecking it a new browser window is not opened on application start up. 如果我在此文件夹中右键单击我的Web角色并选择“ 属性” ,则会获得另一组设置,并且在“ 配置”选项卡上有“ 启动浏览器”标记,取消选中后,应用程序启动时不会打开新的浏览器窗口。


#3楼

CTRL + ALT + ENTER if your amends are front end only 如果你的修正只是前端,请按CTRL + ALT + ENTER

http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link-feature-in-visual-studio-preview-2013.aspx http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link-feature-in-visual-studio-preview-2013.aspx


#4楼

In an ASP.Net 5 project this can now be set for each launch profile. 在ASP.Net 5项目中,现在可以为每个启动配置文件设置此项目。

Open the file launchsettings.json under the Startup Project Properties folder and add "launchBrowser": false to the profile you are configuring, such as in: 在Startup Project Properties文件夹下打开文件launchsettings.json ,并将"launchBrowser": false添加到您正在配置的配置文件中,例如:

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

#5楼

I looked over the answers and didn't see the solution I found mentioned. 我查看了答案,没有看到我发现的解决方案。 If it was, my apologies. 如果是的话,我道歉。 In my case, currently using Visual Studio 2015. In the solution explorer, right click on the Project file and click properties. 就我而言,目前正在使用Visual Studio 2015.在解决方案资源管理器中,右键单击Project文件并单击属性。 Go to the Debug tab and this should have info for how you're launching "IIS Express or Web(DNX)" for the first two drop downs, and then there should be a checkmark box for "Launch URL:". 转到Debug选项卡,这应该有关于如何为前两个下拉列表启动“IIS Express或Web(DNX)”的信息,然后应该有一个“启动URL:”的复选框。 Uncheck this option and your browser won't be automatically launched everytime you go to debug your application. 取消选中此选项,每次调试应用程序时都不会自动启动浏览器。 Hope this helps someone out. 希望这有助于某人。


#6楼

Updated answer for a .NET Core Web Api project... 更新了.NET Core Web Api项目的答案......

Right-click on your project, select "Properties," go to "Debug" and untick the "Launch browser" checkbox (enabled by default). 右键单击项目,选择“属性”,转到“调试”并取消勾选“启动浏览器”复选框(默认启用)。

在此输入图像描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值