[英]Can I configure Visual Studio NOT to change StartUp Project every time I open a file from one of the projects?
Let's say that there is a solution that contains two projects (Project1 and Project2). 假设有一个包含两个项目(Project1和Project2)的解决方案。
Project1 is set as a StartUp Project (its name is displayed in a bold font). Project1设置为StartUp Project(其名称以粗体显示)。 I double-click some file in Project2 to open it. 我双击Project2中的某个文件将其打开。 The file opens, but something else happens too - Project2 gets set as a StartUp Project. 该文件打开,但也发生了其他事情 - Project2被设置为StartUp项目。
I tried to find an option in configuration to change it, but I found none. 我试图在配置中找到一个选项来改变它,但我找不到。
Can this feature (though it's more like a bug to me) be disabled? 可以禁用此功能(虽然它更像是我的错误)吗?
The way to select a startup project is described in Sara Ford's blog "Visual Studio Tip of the Day " (highly recommended). Sara Ford的博客“Visual Studio每日提示 ”(强烈推荐)中介绍了选择启动项目的方法。 She has a post there about setting up StartUp projects . 她有一篇关于设置StartUp项目的帖子。 Essentially there are 2 ways, the easiest one being right-clicking on the desired project, and choosing "Set As StartUp Project". 基本上有两种方法,最简单的方法是右键单击所需的项目,然后选择“设置为启动项目”。 That prevents other projects from becoming the StartUp project, even if you click on one their files. 这可以防止其他项目成为StartUp项目,即使您单击其中一个文件也是如此。
Check your Visual Studio options for the following check box: 检查Visual Studio选项以获取以下复选框:
Projects and Solutions - Build and Run - For new solutions use the currently selected project as the startup project. 项目和解决方案 - 构建和运行 - 对于新解决方案,使用当前选定的项目作为启动项目。
Uncheck that and see if the behavior changes. 取消选中该项,然后查看行为是否发生变化。
I ran into a bug where the project in bold would not be the startup project despite it being selected in the solution properties as the "single startup project". 我遇到了一个错误,即粗体项目不是启动项目,尽管它在解决方案属性中被选为“单一启动项目”。
One work around for this bug was un-checking deploy, from the Configuration Manager, for the non-bold project that was being incorrectly used as the startup project. 解决此错误的一个方法是从配置管理器中取消检查未正确用作启动项目的非粗体项目的部署。 The configuration manager is found by right clicking the solution in the Solution Explorer. 通过右键单击解决方案资源管理器中的解决方案找到配置管理器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.