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

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


当前回答

.user是用户设置,我认为.suo是用户选项的解决方案。您不希望这些文件处于源代码控制之下;它们将为每个用户重新创建。

其他回答

你不需要添加这些——它们包含每个用户的设置,其他开发人员不会想要你的副本。

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, .user, obj/bin目录中任何可能改变每个“用户”的内容通常都不适合源代码控制

如果你在ProjectProperties>Debugging>Environment中设置了可执行目录依赖项,路径将存储在'。用户的文件。

假设我在上面提到的字段中设置这个字符串:"PATH=C:\xyz\bin" 这就是它被存储在'中的方式。用户的文件:

< LocalDebuggerEnvironment >路径= C: \ xyz \ bin美元(LocalDebuggerEnvironment) < / LocalDebuggerEnvironment >

这对我们在OpenCV中工作有很大帮助。我们可以为不同的项目使用不同版本的OpenCV。另一个优点是,在新机器上建立我们的项目非常容易。我们只需要复制相应的依赖dirs。所以对于一些项目,我更喜欢添加'。用户'到源代码控制。

尽管如此,它完全依赖于项目。你可以根据自己的需要接听电话。

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

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

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