.Sln and .suo files in Visual Studio Solutions

In newly created Visual Studio Solutions you’ll find two different files with extensions reminiscent of the word solution, . sln and .suo files. These files, known as the solution files, stores settings specific to the solution. Also, the solution contains a .user file and .csproj files for every project in the solution.

.sln

The .sln file contains the Visual Studio Solution, for example the projects, project items and solution items. It also contains source control settings and other global level settings. It is a text-based file.

The .sln file is shared between developers and should be included in source control.

If the .sln file is deleted, the solution can’t be opened at once anymore, but the individual projects can still be opened (via the .csproj files, see below)

.suo

The .suo file contains the Solution User Options, for example user level customizations such as breakpoints. It is a binary file.

The .suo file is user-specific and should be ignored in source control.

It is safe to delete this file, and deleting it might help problems with hanging debugs.

.user

The .user file is another user option file. It contains things like start options for debugging the project and the last configuration, such as open tabs. It is a text-based file.

The .user file can be included in source control if the developers need the same debug settings, but most often should not be.

.csproj

The .csproj files is project files, and populates the hierrachy with that project’s items. It wraps relevant references etc

The .csproj files should be included in source control.

 

Leave a Reply

Your email address will not be published. Required fields are marked *