views:

10310

answers:

14

Visual Studio solutions contain two types of hidden user files. One is the solution .suo file which is a binary file. The other is the project .user file which is a text file. Does anyone know exactly what data these files contain? I've also been wondering whether I should be adding these files to source control (Subversion in my case). If I don't add these files and another developer checks out the solution, will Visual Studio automatically create new user files?

+35  A: 

You don't need to add these -- they contain per-user settings, and other developers won't want your copy.

Steve Cooper
If you're working by yourself on several different machines would it be worth it to add them?
thepocketwade
+3  A: 

Visual Studio will automatically create them. I don't recommend putting them in source control. There have been numerous times where a local developer's SOU file was causing VS to behave erratically on that developers box. Deleting the file and then letting VS recreate it always fixed the issues.

Bloodhound
+1  A: 

By default Microsoft's Visual SourceSafe does not include these files in the source control because they are user-specific settings files. I would follow that model if you're using SVN as source control.

cori
A: 

.user is the user settings, and I think .suo is the solution user options. You don't want these files under source control; they will be re-created for each user.

Nick
+1  A: 

Using Rational ClearCase the answer is no, only the .sln & .*proj should be registered in source code control, I can't answer for other vendors. If I recall correctly these files are "user" specific options, your environment.

titanae
+3  A: 

These files are user-specific options, which should be independent of the solution itself. Visual Studio will create new ones as necessary, so they do not need to be checked in to source control. Indeed, it would probably be better not to as this allows individual developers to customize their environment as they see fit.

benefactual
A: 

They contains the specific settings about project that are tipically assigned to a single developer (like, for example, the starting project and starting page to start when you debug your application).
So it's better not adding them to version control, leaving VS recreate them so that each developer can have the specific settings he wants.

massimogentilini
+3  A: 

We don't commit the binary file (*.suo), but we commit the .user file. The .user file contains for example the start options for debugging the project. You can find the start options in the properties of the project in the tab "Debug". We used NUnit in some projects and configured the nunit-gui.exe as the start option for the project. Without the .user file, each team member have to configure it separately.

Hope this helps.

Thomas
A: 

I wouldn't. Anything that could change per "user" is usually not good in source control. .suo, .user, obj/bin directories

ScaleOvenStove
A: 

This appears to be Microsoft's opinion on the matter: http://social.msdn.microsoft.com/forums/en-US/vssourcecontrol/thread/dee90d75-d825-4c76-a30f-016eab15ef7f

Scott W
+1  A: 

you cannot source-control the .user files because that's user specific. it contains the name of remote machine and other user dependent things. it's a vcproj related file

the .suo is a sln related file and it contains the "solution user options" (startup project(s), windows position (what's docked and where, what's floating), etc )

it's a binary file, I don't know if it contains something "user related".

In our company we do not take under source control those files.

ugasoft
+4  A: 

No, you should not add them to source control since - as you said - they're user specific.

SUO (Solution User Options): Records all of the options that you might associate with your solution so that each time you open it, it includes customizations that you have made.

The .user file contains the user options for the project (while SUO is for the solution) and extends the project file name (e.g. anything.csproj.user contains user settings for the anything.csproj project).

JRoppert
+48  A: 

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 allways be marked by the SCM as 'changed'. I don't include both, 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 o 'publish' it via SCM for other developers to have the entire development environment 'ready to use'.

Fabio Ceconello
+4  A: 

Others have explained why adding the *.suo and *.user files to source control is not a good idea.

I'd like to suggest that you set the svn:ignore property to include those types of files, for 2 reasons:

  1. So other developers won't wind up with one developer's settings.
  2. So when you view status, or commit files, those files won't clutter the code base and obscure new files you need to add.
JXG