我已经打开了一个窗口与我正在调试的网站。我不需要VS为我启动另一个每当我需要调试。

有没有办法阻止这种行为?


当前回答

如果您在IIS中使用Web发布特性,那么我发现的解决方案是编辑发布配置并从配置中删除Destination URL(让它为空)。

如果定义了这个,那么每次发布项目时,它都会打开Destination URL中指定的URL(这是一个重定向URL)。

参考:https://support.winhost.com/kb/a1604/visual-studio-publish-web-deploy.aspx

其他回答

打开启动项目的属性(project→{ProjectName} properties…从主菜单或在“解决方案资源管理器”中右键单击项目并选择“属性”),然后导航到“Web”选项卡,在“开始操作”下选择“不打开页面”。等待来自外部应用程序的请求。

您仍然可以使用任何浏览器(或Fiddler,无论什么)来访问正在运行的应用程序,但它不会自动打开浏览器窗口,它只是在后台启动并等待任何请求。

以下是对我有用的方法:

去项目属性>调试>取消“启动浏览器”>保存。

Joao Costa的答案同样适用于。net core 2项目。

launchsettings。json——> "launchBrowser": false

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

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. 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:". Uncheck this option and your browser won't be automatically launched everytime you go to debug your application. Hope this helps someone out.

虽然有几个很好的答案,从通常的怀疑到更新的解决方案,但我想再提供一个解决方案,以解决当您在多个项目中处理一个解决方案时应该做的事情。

在得到这个解决方案之前,我一直在应用程序主机中查看bindingInformation。配置解决方案,不知疲倦地寻找为什么事情不工作的任何线索。

事实证明,我忽略了一个简单的事情,那就是不同的项目也有各自的设置。 因此,除了Project > {Project- name}属性…> Web >开始行动在我的后端项目,我还必须去网站>开始选项…开始行动在我的Frontend项目。在那里,我选择了不要打开页面。等待来自外部应用程序的请求,从那时起就一直很快乐!