Which files in a Visual C# Studio project don't need to be versioned?

Solution 1:

Dont include
bin
obj
*.suo
*.user
_Resharper* (if you have Resharper)

Include
*.sln
*.csproj

You can also check the .gitignore file for visual studio projects on github.

Solution 2:

.csproj defines the project structure. It is vital.

This is what I add to my global ignore list in Tortoise SVN:

*.suo *.user bin obj *.pdb *.cache *_svn *.svn *.suo *.user *.build-res TestResults _ReSharper*

Solution 3:

Shouldn't be versioned:

  • .csproj.user is the user's project file settings (e.g. startup project)
  • .suo is the user's solution file settings

Should be versioned:

  • .sln is the solution file itself (what projects it contains etc)
  • .csproj is the project file

I'm not sure about "contentproj" but it sounds like it's a project file which should be under svn.

Solution 4:

The .sln file defines your solution together with the .proj files (one for each project), so keep them in your svn!

You can skip the .suo file (personal settings - binary anyway) as well as the bin or obj folders. Also the .cache files can be left.

Solution 5:

Just to add, anything that gets regenerated at build time, should be excluded. For example, files generated from the prebuild event or in some cases a custom tool.