Visual Studio解决方案包含两种类型的隐藏用户文件。一个是解决方案。suo文件,这是一个二进制文件。另一个是project .user文件,它是一个文本文件。这些文件到底包含哪些数据?

我也一直在考虑是否应该将这些文件添加到源代码控制(在我的情况下是Subversion)。如果我没有添加这些文件,而另一个开发人员签出了解决方案,Visual Studio会自动创建新的用户文件吗?


当前回答

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'.

其他回答

其他人解释了为什么有*。Suo和*。在源代码控制下的用户文件不是一个好主意。

我建议你将这些模式添加到svn:ignore属性中,原因有二:

这样其他开发商就不会倒闭了 一个开发人员的设置。 所以当你查看状态或提交时 文件,这些文件不会使代码库变得混乱,也不会使您需要添加的新文件变得模糊。

不,您不应该将它们添加到源代码控制中,因为—正如您所说—它们是特定于用户的。

SUO(解决方案用户选项):记录 所有可能的选择 把你的解决方案联系起来 每次你打开它,里面都有 自定义 取得了。

.user文件包含项目的用户选项(而SUO是解决方案)并扩展了项目文件名(例如anything.csproj.user包含anything.csproj.user的用户设置)。csproj项目)。

由于我在2011年通过谷歌找到了这个问题/答案,我想我应该花点时间添加*的链接。由Visual Studio 2010创建的SDF文件被添加到可能不应该添加到版本控制的文件列表中(IDE将重新创建它们)。因为我不确定a *。sdf文件可能在其他地方有一个合法的用途,我只是忽略了特定的[projectname]。sdf文件。

为什么Visual Studio转换向导2010创建一个巨大的SDF数据库文件?

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'.

它们包含有关项目的特定设置,这些设置通常分配给单个开发人员(例如,在调试应用程序时启动的启动项目和开始页面)。

所以最好不要把它们添加到版本控制中,让VS重新创建它们,这样每个开发人员都可以有他们想要的特定设置。