I began to use Visual Studio 2010. After I'm done with the C# program, I see that there are .sln
, and .suo
files in the project root directory, and a .csproj
file in the subdirectory. What are those files for?
I need to identify the files to put into a Git repository. Together with the source code/documents that I create, I guess those three files are the only one that I have to take care of. However, I'm not sure if I'm tracking the correct files.
ADDED
How about the personal macro files? I have the Emacs key switch macro, does the .sln
file or .csproj
file have this macro?
You should commit the
.sln
and the.csproj
, but not the.suo
or the.user
files.You can add the following to
.gitignore
:SLN (Solution) are the solution files. It stores info about the collection of projects that make up whatever you are developing. They contain projects, source control settings, or any other global level thing.
CSProj(Project file) are the actual code projects (C# Libraries, WCF Services, etc). It stores information at the project level. It wraps all relevant References, Classess, etc..
SUO (solution user options) are user settings files. Completely disposable, you can delete it and the most common thing you will lose are breakpoints.
Push everything except the SUO settings files.
Do not include any bin, debug, obj directory. The only DLLs (or compiled/generated object) you should include are those that are external to your application.
From MSDN:
Furthermore, also from MSDN:
You do not need to put
.suo
file in VCS. That is a user-specific file.The SUO files do 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 are not always using the solution defaults for Startup Project or platform. I find it annoying that if I grab a new project it does not default to 64 bit and the proper platform. The SUO contains the settings to set these defaults properly.
The down side of this is that it's a binary file, so pretty much each time you open the solution and do anything the file will have changed. Typically the file is less than 100k, and unless you know you changed something, I don't commit the change.