我已经打开了一个窗口与我正在调试的网站。我不需要VS为我启动另一个每当我需要调试。
有没有办法阻止这种行为?
我已经打开了一个窗口与我正在调试的网站。我不需要VS为我启动另一个每当我需要调试。
有没有办法阻止这种行为?
当前回答
由于我的VS (Visual Studio Enterprise 2017)中没有上述选项,我不得不寻找其他选项。
以下是我的发现:
进入“工具->选项->调试”选项卡(通用),取消选中“为Asp启用JavaScript调试”。Net(Chrome和IE)。
其他回答
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. 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. However, there is the main cloud project in solution explorer and there is the Roles folder under it. 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.
对于VS2022和ASP。NET核心:
另一个快捷方式是:单击右边绿色三角形按钮上的小下拉按钮,上面有项目名称,这通常会启动调试版本。然后是最后一个选项“{项目名}调试属性”,它直接启动专用的UI窗口。
从那里遵循@irf的建议:
“uncheck”选项不自动打开。
在Visual Studio 2019中,我解决了同样的问题:
去你的Visual Studio选项工具>>>选项>>>项目和解决方案>>> Web项目然后最后取消选项>>>停止调试器浏览器窗口关闭,关闭浏览器时调试停止
步骤1:
步骤2: >>>关闭调试器浏览器窗口,调试停止时关闭浏览器
步骤3:
最后点击>>> OK按钮,这些都是解决问题的步骤。
Joao Costa的答案同样适用于。net core 2项目。
launchsettings。json——> "launchBrowser": false
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": false,
"environmentVariables": {
"Hosting:Environment": "Development"
}
}
}
.NET核心Web Api项目的更新答案…
右键单击项目,选择“属性”,转到“调试”,取消“启动浏览器”复选框(默认启用)。