views:

101

answers:

3

I begin to use visual studio 10. After I'm done with C# program, I see that there are sln, and suo file in the project root directory, and csproj file in the subdirectory.

What are those files for?

I need to identify the files to put into 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. Is that correct?

ADDED

How about the personal macro files? I have the emacs key swtich macro, does the sln file or csproj file have this macro?

+4  A: 

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

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*
SLaks
If you want to share the debugging/command line args then the .user file is useful to put in version control
Tim
+3  A: 

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.

Nix