您可以将启动操作/启动项目存储在project/sln文件中吗? [英] Can you store start action / startup projects in project/sln files?

查看:107
本文介绍了您可以将启动操作/启动项目存储在project/sln文件中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我更改Web应用程序项目的开始操作"(例如当前页面",特定页面",不打开页面"等)并保存时,Visual Studio不会将此选择存储在很可能会得到的文件中已签入到源控制,例如csprojsln.同样,如果我转到解决方案属性并选择多个启动项目并保存,则此选择也不会存储在此类文件中.有没有一种方法可以将这些信息存储在将签入源代码管理的文件中,而不是用户设置文件中?

When I change a web application project's Start Action (such as Current Page, Specific Page, Don't open a page, etc.) and save, Visual Studio doesn't store this selection in a file that is likely to get checked in to source control such as csproj or sln. Likewise, if I go to solution properties and select several multiple startup projects and save, this selection is not stored in such a file either. Is there a way I can store this info in files that will get checked in to source control rather than user settings files?

推荐答案

这些配置存储在解决方案用户选项(.suo)文件中,而不是存储在源代码管理中, Microsoft文档:

These configurations are stored in the Solution User Options (.suo) file and they are not meant to be stored in source control, Microsoft Documentations:

解决方案用户选项(.suo)文件包含每个用户的解决方案 选项.此文件不应签入源代码控制.

The solution user options (.suo) file contains per-user solution options. This file should not be checked in to source code control.

启动项目,是按用户设置的...测试人员可能想要为他的启动设置测试项目,而开发人员则需要Web项目.开发人员不希望每次获取最新版本时都将其个人设置覆盖.

Startup Project, is a per user settings... a tester may want to set the test project for his startup while the developer wants the web project. The developer does not want his personal settings overwritten, every time he gets the latest version.

但是,您可以选择默认的 Startup Project ,当没有.suo文件...时将使用该默认名称:

But, you can choose a default Startup Project, which would be used when there is no .suo file... to do this:

在文本编辑器中打开您的解决方案文件(.sln),您会在此文件顶部的Project& EndProject标签.

Open your solution file (.sln) in a text editor, you would see a list of your projects on top of this file, between Project & EndProject tags.

此列表中的第一个项目将成为您的默认启动项目,因此您可以对项目列表进行重新排序,并将.sln文件保存在源代码管理中.

The first project in this list would become your default startup project, so you can reorder the project list and save your .sln file in source control.

现在,如果您删除.suo文件并在Visual Studio中重新打开解决方案,则列表中的第一个项目将成为您的启动项目...,Visual Studio将为您创建一个新的.suo文件.我在

Now if you delete your .suo file and reopen your solution in Visual Studio, the first project from the list becomes your startup project... and Visual Studio would create a new .suo file for you. I found this information on this stackoverflow post.

这篇关于您可以将启动操作/启动项目存储在project/sln文件中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆