Should I add the Visual Studio .suo and .user files to source control?

Ben Mills Source

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. Exactly what data do these files contain?

I've also been wondering whether I should add 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?



answered 9 years ago Steve Cooper #1

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

answered 9 years ago Bloodhound #2

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.

answered 9 years ago cori #3

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.

answered 9 years ago Nick #4

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

answered 9 years ago titanae #5

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.

answered 9 years ago benefactual #6

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.

answered 9 years ago massimogentilini #7

They contain the specific settings about the project that are typically 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 they want.

answered 9 years ago Thomas #8

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 would have to configure it separately.

Hope this helps.

answered 9 years ago ScaleOvenStove #9

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

answered 9 years ago Scott W #10

This appears to be Microsoft's opinion on the matter:

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)

answered 9 years ago ugasoft #11

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 file 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, and I don't know if it contains something "user related".

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

answered 9 years ago JRoppert #12

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

answered 9 years ago Fabio Ceconello #13

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

answered 9 years ago JXG #14

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

I'd like to suggest that you add these patterns to the svn:ignore property 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.

answered 7 years ago Stephen #15

Since I found this question/answer through Google in 2011, I thought I'd take a second and add the link for the *.SDF files created by Visual Studio 2010 to the list of files that probably should not be added to version control (the IDE will re-create them). Since I wasn't sure that a *.sdf file may have a legitimate use elsewhere, I only ignored the specific [projectname].sdf file from SVN.

Why does the Visual Studio conversion wizard 2010 create a massive SDF database file?

answered 2 years ago Farax #16

On the MSDN website, it clearly states that

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

So I'd say it is pretty safe to ignore these files while checking in stuff to your source control.

comments powered by Disqus