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

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


当前回答

对于VS2022和ASP。NET核心:

另一个快捷方式是:单击右边绿色三角形按钮上的小下拉按钮,上面有项目名称,这通常会启动调试版本。然后是最后一个选项“{项目名}调试属性”,它直接启动专用的UI窗口。

从那里遵循@irf的建议:

“uncheck”选项不自动打开。

其他回答

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

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

您可以右键单击您的项目,然后选择属性,在调试选项卡上,您应该取消选中启动浏览器复选框。

VS 15.7.1工具→选项→项目和解决方案→Web项目→取消勾选关闭浏览器窗口时停止调试器。

您可以使用“附加到进程”功能,而不是按F5。

这也可以让你在已知的工作部分中导航,而不会在下面加载VS调试器。

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.