Visual Studio解决方案包含两种类型的隐藏用户文件。一个是解决方案。suo文件,这是一个二进制文件。另一个是project .user文件,它是一个文本文件。这些文件到底包含哪些数据?
我也一直在考虑是否应该将这些文件添加到源代码控制(在我的情况下是Subversion)。如果我没有添加这些文件,而另一个开发人员签出了解决方案,Visual Studio会自动创建新的用户文件吗?
Visual Studio解决方案包含两种类型的隐藏用户文件。一个是解决方案。suo文件,这是一个二进制文件。另一个是project .user文件,它是一个文本文件。这些文件到底包含哪些数据?
我也一直在考虑是否应该将这些文件添加到源代码控制(在我的情况下是Subversion)。如果我没有添加这些文件,而另一个开发人员签出了解决方案,Visual Studio会自动创建新的用户文件吗?
当前回答
我们不提交二进制文件(*.suo),但我们提交.user文件。例如,.user文件包含用于调试项目的启动选项。你可以在“Debug”选项卡的项目属性中找到启动选项。我们在一些项目中使用了NUnit,并配置了NUnit -gui.exe作为项目的开始选项。如果没有.user文件,每个团队成员都必须单独配置它。
希望这能有所帮助。
其他回答
其他人解释了为什么有*。Suo和*。在源代码控制下的用户文件不是一个好主意。
我建议你将这些模式添加到svn:ignore属性中,原因有二:
这样其他开发商就不会倒闭了 一个开发人员的设置。 所以当你查看状态或提交时 文件,这些文件不会使代码库变得混乱,也不会使您需要添加的新文件变得模糊。
These files contain user preference configurations that are in general specific to your machine, so it's better not to put it in SCM. Also, VS will change it almost every time you execute it, so it will always be marked by the SCM as 'changed'. I don't include either, I'm in a project using VS for 2 years and had no problems doing that. The only minor annoyance is that the debug parameters (execution path, deployment target, etc.) are stored in one of those files (don't know which), so if you have a standard for them you won't be able to 'publish' it via SCM for other developers to have the entire development environment 'ready to use'.
Visual Studio会自动创建它们。我不建议把它们放在源代码控制中。曾经有很多次,本地开发人员的SOU文件导致VS在开发人员的盒子上表现不稳定。删除文件,然后让VS重新创建它总是修复问题。
.user是用户设置,我认为.suo是用户选项的解决方案。您不希望这些文件处于源代码控制之下;它们将为每个用户重新创建。
这似乎是微软对此事的看法:
添加(并编辑).suo文件到源代码控制
I don't know why your project stores the DebuggingWorkingDirectory in the suo file. If that is a user specific setting you should consider storing that in the *.proj.user filename. If that setting is shareable between all users working on the project you should consider storing it in the project file itself. Don't even think of adding the suo file to source control! The SUO (soluton user options) file is meant to contain user-specific settings, and should not be shared amongst users working on the same solution. If you'd be adding the suo file in the scc database I don't know what other things in the IDE you'd break, but from source control point of view you will break web projects scc integration, the Lan vs Internet plugin used by different users for VSS access, and you could even cause the scc to break completely (VSS database path stored in suo file that may be valid for you may not be valid for another user). Alin Constantin (MSFT)