<p>Visual Studio solutions contain two types of hidden user files. One is the solution <code>.suo</code> file which is a binary file. The other is the project <code>.user</code> file which is a text file. Exactly what data do these files contain?</p>

<p>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?</p>

[{'answer_id': 72327, 'author': 'Steve Cooper', 'author_id': 6722, 'author_profile': 'https://Stackoverflow.com/users/6722', 'pm_score': 7, 'selected': False, 'text': "<p>You don't need to add these -- they contain per-user settings, and other developers won't want your copy.</p>\n"}, {'answer_id': 72329, 'author': 'Mike Becatti', 'author_id': 6617, 'author_profile': 'https://Stackoverflow.com/users/6617', 'pm_score': 4, 'selected': False, 'text': "<p>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.  </p>\n"}, {'answer_id': 72336, 'author': 'cori', 'author_id': 8151, 'author_profile': 'https://Stackoverflow.com/users/8151', 'pm_score': 4, 'selected': False, 'text': "<p>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.</p>\n"}, {'answer_id': 72344, 'author': 'Nick', 'author_id': 1490, 'author_profile': 'https://Stackoverflow.com/users/1490', 'pm_score': 3, 'selected': False, 'text': "<p>.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.</p>\n"}, {'answer_id': 72347, 'author': 'titanae', 'author_id': 2387, 'author_profile': 'https://Stackoverflow.com/users/2387', 'pm_score': 2, 'selected': False, 'text': '<p>Using Rational <a href="https://en.wikipedia.org/wiki/Rational_ClearCase" rel="nofollow noreferrer">ClearCase</a> the answer is no. Only the .sln &amp; .*proj should be registered in source code control.</p>\n\n<p>I can\'t answer for other vendors. If I recall correctly, these files are "user" specific options, your environment.</p>\n'}, {'answer_id': 72349, 'author': 'benefactual', 'author_id': 6445, 'author_profile': 'https://Stackoverflow.com/users/6445', 'pm_score': 3, 'selected': False, 'text': '<p>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.</p>\n'}, {'answer_id': 72362, 'author': 'massimogentilini', 'author_id': 11673, 'author_profile': 'https://Stackoverflow.com/users/11673', 'pm_score': 3, 'selected': False, 'text': "<p>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).</p>\n\n<p>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. </p>\n"}, {'answer_id': 72370, 'author': 'Thomas', 'author_id': 4980, 'author_profile': 'https://Stackoverflow.com/users/4980', 'pm_score': 6, 'selected': False, 'text': '<p>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.</p>\n\n<p>Hope this helps.</p>\n'}, {'answer_id': 72454, 'author': 'ScaleOvenStove', 'author_id': 12268, 'author_profile': 'https://Stackoverflow.com/users/12268', 'pm_score': 3, 'selected': False, 'text': '<p>I wouldn\'t. Anything that could change per "user" is usually not good in source control. .suo, .user, obj/bin directories</p>\n'}, {'answer_id': 72457, 'author': 'Scott W', 'author_id': 3032, 'author_profile': 'https://Stackoverflow.com/users/3032', 'pm_score': 4, 'selected': False, 'text': '<p>This appears to be Microsoft\'s opinion on the matter:</p>\n\n<p><em><a href="http://social.msdn.microsoft.com/forums/en-US/vssourcecontrol/thread/dee90d75-d825-4c76-a30f-016eab15ef7f" rel="noreferrer">Adding (and editing) .suo files to source control</a></em></p>\n\n<blockquote>\n  <p>I don\'t know why your project stores the DebuggingWorkingDirectory in\n  the suo file. If that is a user specific setting you should consider\n  storing that in the *.proj.user filename. If that setting is shareable\n  between all users working on the project you should consider storing\n  it in the project file itself.</p>\n  \n  <p><strong>Don\'t even think of adding the suo file to source control!</strong> The SUO\n  (soluton user options) file is meant to contain user-specific\n  settings, and should not be shared amongst users working on the same\n  solution. If you\'d be adding the suo file in the scc database I don\'t\n  know what other things in the IDE you\'d break, but from source control\n  point of view you will break web projects scc integration, the Lan vs\n  Internet plugin used by different users for VSS access, and you could\n  even cause the scc to break completely (VSS database path stored in\n  suo file that may be valid for you may not be valid for another user).</p>\n  \n  <p>Alin Constantin (MSFT)</p>\n</blockquote>\n'}, {'answer_id': 72502, 'author': 'ugasoft', 'author_id': 10120, 'author_profile': 'https://Stackoverflow.com/users/10120', 'pm_score': 3, 'selected': False, 'text': '<p>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.</p>\n\n<p>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.)</p>\n\n<p>It\'s a binary file, and I don\'t know if it contains something "user related".</p>\n\n<p>In our company we do not take those files under source control.</p>\n'}, {'answer_id': 72511, 'author': 'JRoppert', 'author_id': 6777, 'author_profile': 'https://Stackoverflow.com/users/6777', 'pm_score': 5, 'selected': False, 'text': "<p>No, you should not add them to source control since - as you said - they're user specific.</p>\n\n<blockquote>\n  <p>SUO (Solution User Options): Records\n  all of the options that you might\n  associate with your solution so that\n  each time you open it, it includes\n  customizations that you\n  have made. </p>\n</blockquote>\n\n<p>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).</p>\n"}, {'answer_id': 72662, 'author': 'Fabio Ceconello', 'author_id': 8999, 'author_profile': 'https://Stackoverflow.com/users/8999', 'pm_score': 10, 'selected': True, 'text': "<p>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'.\nI 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'.</p>\n"}, {'answer_id': 84115, 'author': 'JXG', 'author_id': 15456, 'author_profile': 'https://Stackoverflow.com/users/15456', 'pm_score': 6, 'selected': False, 'text': "<p>Others have explained why having the <code>*.suo</code> and <code>*.user</code> files under source control is not a good idea.</p>\n\n<p>I'd like to suggest that you add these patterns to the <code>svn:ignore</code> property for 2 reasons:</p>\n\n<ol>\n<li>So other developers won't wind up\nwith one developer's settings.</li>\n<li>So when you view status, or commit\nfiles, those files won't clutter the code base and obscure new files you need to add.</li>\n</ol>\n"}, {'answer_id': 6572710, 'author': 'Stephen', 'author_id': 759749, 'author_profile': 'https://Stackoverflow.com/users/759749', 'pm_score': 5, 'selected': False, 'text': '<p>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.</p>\n\n<p><em><a href="https://stackoverflow.com/q/4237660/759749">Why does the Visual Studio conversion wizard 2010 create a massive SDF database file?</a></em></p>\n'}, {'answer_id': 37312993, 'author': 'Farax', 'author_id': 194490, 'author_profile': 'https://Stackoverflow.com/users/194490', 'pm_score': 4, 'selected': False, 'text': '<p>On the <a href="https://msdn.microsoft.com/en-us/library/bb165909.aspx" rel="noreferrer">MSDN website</a>, it clearly states that </p>\n\n<blockquote>\n  <p>The solution user options (.suo) file contains per-user solution\n  options. <strong>This file should not be checked in to source code control</strong>.</p>\n</blockquote>\n\n<p>So I\'d say it is pretty safe to ignore these files while checking in stuff to your source control. </p>\n'}, {'answer_id': 51533299, 'author': 'adheen', 'author_id': 1320144, 'author_profile': 'https://Stackoverflow.com/users/1320144', 'pm_score': 1, 'selected': False, 'text': '<p>If you set your executable dir dependencies in <strong>ProjectProperties>Debugging>Environment</strong>, the paths are stored in \'.user\' files. </p>\n\n<p>Suppose I set this string in above-mentioned field: <strong>"PATH=C:\\xyz\\bin"</strong>\nThis is how it will get stored in \'.user\' file:  </p>\n\n<p><code>&lt;LocalDebuggerEnvironment&gt;PATH=C:\\xyz\\bin$(LocalDebuggerEnvironment)&lt;/LocalDebuggerEnvironment&gt;</code></p>\n\n<p>This helped us a lot while working in OpenCV. We could use different versions of OpenCV for different projects. Another advantage is, it was very easy to set up our projects on a new machine. We just had to copy corresponding dependency dirs. So for some projects, I prefer to add the \'.user\' to source control. </p>\n\n<p>Even though, it is entirely dependent on projects. You can take a call based on your needs.</p>\n'}, {'answer_id': 53274135, 'author': 'Amila', 'author_id': 1226396, 'author_profile': 'https://Stackoverflow.com/users/1226396', 'pm_score': 2, 'selected': False, 'text': "<p><strong>Don't add any of those files into version control.</strong> These files are auto generated with work station specific information, if checked-in to version control that will cause trouble in other work stations. </p>\n"}, {'answer_id': 54726210, 'author': 'Stephen Kennedy', 'author_id': 397817, 'author_profile': 'https://Stackoverflow.com/users/397817', 'pm_score': 2, 'selected': False, 'text': '<p>No, they shouldn\'t be committed to source control as they are developer/machine-specific local settings.</p>\n\n<p>GitHub maintain a list of suggested file types for Visual Studio users to ignore at <a href="https://github.com/github/gitignore/blob/master/VisualStudio.gitignore" rel="nofollow noreferrer">https://github.com/github/gitignore/blob/master/VisualStudio.gitignore</a></p>\n\n<p>For svn, I have the following <code>global-ignore</code> property set:</p>\n\n<blockquote>\n  <p>*.DotSettings.User<br/>\n  *.onetoc2<br/>\n  *.suo<br/> .vs<br/> PrecompiledWeb<br/> thumbs.db<br/> obj<br/> bin<br/> debug<br/>\n  *.user<br/> &#42;.vshost.&#42;<br/>\n  *.tss<br/>\n  *.dbml.layout<br/></p>\n</blockquote>\n'}, {'answer_id': 55900626, 'author': 'AntonK', 'author_id': 536172, 'author_profile': 'https://Stackoverflow.com/users/536172', 'pm_score': 2, 'selected': False, 'text': "<p>As explained in other answers, both <code>.suo</code> and <code>.user</code> shouldn't be added to source control, since they are user/machine-specific (BTW <code>.suo</code> for newest versions of VS was moved into dedicated temporary directory <code>.vs</code>, which should be kept out of source control completely).</p>\n\n<p><strong>However</strong> if your application requires some setup of environment for debugging in VS (such settings are usually kept in <code>.user</code> file), it may be handy to prepare a sample file (naming it like <code>.user.SAMPLE</code>) and add it to source control for references.</p>\n\n<p>Instead of hard-coded absolute path in such file, it makes sense to use relative ones or rely on environment variables, so the sample may be generic enough to be easily re-usable by others.</p>\n"}, {'answer_id': 57367656, 'author': 'Pablo Carrasco Hernández', 'author_id': 4721833, 'author_profile': 'https://Stackoverflow.com/users/4721833', 'pm_score': 4, 'selected': False, 'text': "<p>No.</p>\n\n<blockquote>\n  <p>I just wanted a real short answer, and there wasn't any.</p>\n</blockquote>\n"}, {'answer_id': 66044006, 'author': 'Drew Noakes', 'author_id': 24874, 'author_profile': 'https://Stackoverflow.com/users/24874', 'pm_score': 3, 'selected': False, 'text': '<p>Others have explained that no, you don\'t want this in version control. You should configure your version control system to ignore the file (e.g. via a <code>.gitignore</code> file).</p>\n<p>To really understand why, it helps to see what\'s actually in this file. I wrote a command line tool that lets you see the <code>.suo</code> file\'s contents.</p>\n<p>Install it on your machine via:</p>\n<pre><code>dotnet tool install -g suo\n</code></pre>\n<p>It has two sub-commands, <code>keys</code> and <code>view</code>.</p>\n<pre><code>suo keys &lt;path-to-suo-file&gt;\n</code></pre>\n<p>This will dump out the key for each value in the file. For example (abridged):</p>\n<pre><code>nuget\nProjInfoEx\nBookmarkState\nDebuggerWatches\nHiddenSlnFolders\nObjMgrContentsV8\nUnloadedProjects\nClassViewContents\nOutliningStateDir\nProjExplorerState\nTaskListShortcuts\nXmlPackageOptions\nBackgroundLoadData\nDebuggerExceptions\nDebuggerFindSource\nDebuggerFindSymbol\nILSpy-234190A6EE66\nMRU Solution Files\nUnloadedProjectsEx\nApplicationInsights\nDebuggerBreakpoints\nOutliningStateV1674\n...\n</code></pre>\n<p>As you can see, lots of IDE features use this file to store their state.</p>\n<p>Use the <code>view</code> command to see a given key\'s value. For example:</p>\n<pre><code>$ suo view nuget --format=utf8 .suo\nnuget\n\n?{&quot;WindowSettings&quot;:{&quot;project:MyProject&quot;:{&quot;SourceRepository&quot;:&quot;nuget.org&quot;,&quot;ShowPreviewWindow&quot;:false,&quot;ShowDeprecatedFrameworkWindow&quot;:true,&quot;RemoveDependencies&quot;:false,&quot;ForceRemove&quot;:false,&quot;IncludePrerelease&quot;:false,&quot;SelectedFilter&quot;:&quot;UpdatesAvailable&quot;,&quot;DependencyBehavior&quot;:&quot;Lowest&quot;,&quot;FileConflictAction&quot;:&quot;PromptUser&quot;,&quot;OptionsExpanded&quot;:false,&quot;SortPropertyName&quot;:&quot;ProjectName&quot;,&quot;SortDirection&quot;:&quot;Ascending&quot;}}}\n</code></pre>\n<p>More information on the tool here: <a href="https://github.com/drewnoakes/suo" rel="noreferrer">https://github.com/drewnoakes/suo</a></p>\n'}]
['https://Stackoverflow.com/questions/72298', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/203/']