views:

77

answers:

5

I'd like to use git to manage my various Visual Studio projects. Unfortunately they seem to consist of a multitude of files beyond the one or two .cs files my code is contained in.

Which of these files is actually required to build the project?

+1  A: 

All you need are the project and solution files. csproj, vbproj, sln.

edit

I meant in addition to the actual files inside the projects.

Steven Sudit
+2  A: 

.csproj, assemblyinfo.cs, plus your code and solution (.sln) file.

Also, you might take a look at cleansoureplus from Jeff. This program will clean out all unnecessary files and folders.

Timothy Carter
+1  A: 

I think it's easier to look at a Visual Studio project and know what to exclude from a project. There are too many different flavors of visual studio projects to possibly list all of the file types which are important. However the unimportant files usually follow a specific pattern.

In general I exclude the following directories and files

Directories:

  • bin
  • obj

Files Extensions:

  • *.suo
  • *.sdf
  • *.user
  • *.obj
  • *.dll
  • *.exe
JaredPar
A: 

Be sure to look in the project file to see what files are part of it.

John Saunders
+1  A: 

You should only need:

  • *.cs code files
  • the .csproj file
  • any form files (.cs, Designer.cs, and .resx)
  • the Properties directory and contents (AssemblyInfo.cs)
Hoser