Why are there .sln, .suo, and .csproj files?

I started using Visual Studio 2010. After I finished the C # program, I see that there are .sln and .suo files in the project root directory and the .suo file in the subdirectory, What are these files for?

I need to identify files for placement in a Git repository. Together with the source code / documents that I create, I think these three files are the only ones I should take care of. However, I am not sure that I am tracking the correct files.

ADDED

What about personal macro files? I have an Emacs key macro, is this a .sln or .csproj ?

+51
git visual-studio
Oct 6 2018-10-06
source share
4 answers

You must commit the .sln and .csproj , but not the .suo or .user .

You can add the following to .gitignore :

 #ignore thumbnails created by windows Thumbs.db #Ignore files build by Visual Studio *.obj *.exe *.pdb *.user *.aps *.pch *.vspscc *_i.c *_p.c *.ncb *.suo *.tlb *.tlh *.bak *.cache *.ilk *.log [Bb]in [Dd]ebug*/ *.lib *.sbr obj/ [Rr]elease*/ _ReSharper*/ [Tt]est[Rr]esult* 
+63
Oct 06 2018-10-06
source share
β€” -

SLN (Solution) - solution files. It stores information about the collection of projects that make up everything that you develop. They contain projects, control source settings, or any other things globally.

CSProj (project file) are the actual code projects (C # libraries, WCF services, etc.). It stores information at the project level. It includes all relevant links, Classess, etc.

SUO (solution user settings) are user settings files. Completely disposable, you can delete it, and the most common thing that you lose is breakpoints.




Click everything except SUO settings files.

Do not include the bin, debug, obj directory. The only DLLs (or compiled / generated objects) that you should include are those that are external to your application.

+37
06 Oct 2018-10-10
source share

From MSDN:

A solution (.sln) is a structure for organizing projects in Visual Studio. It performs a function similar to the Windows Program Group (.vbg) files in Visual Basic 6.0 files and project workspace files (.dsw) in Visual C ++ 6.0. The solution supports status information for projects in .sln files (text, general) and .suo (binary, custom solutions) ... [Source]

In addition, also from MSDN:

A solution file (.suo) is a structured repository or compound file stored in binary format. You save user information in streams with the stream name being the key that will be used to identify the information in the .suo file ... [Source]

You do not need to embed the .suo file in VCS. This is a custom file.

+13
Oct 06 '10 at 15:00
source share

SUO files have a purpose, and I disagree with the statement that they should always be ignored. I do not ignore them, and as a general practice, I add them to our SVN repository. My projects do not always use the default values ​​for a Startup Project or platform. I find it annoying that if I take a new project, it will not default to 64 bits and the correct platform. SUO contains settings to correctly set these defaults.

The downside of this is that it is a binary file, so almost every time you open a solution and do something, the file will be modified. Usually the file is less than 100 thousand, and if you do not know that you have changed something, I do not commit the change.

+3
Aug 13 '13 at 13:48 on
source share



All Articles