Simon Morgan
Simon Morgan

Reputation: 2248

Which files are required for a Visual Studio project?

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?

Upvotes: 4

Views: 3367

Answers (5)

Hoser
Hoser

Reputation: 749

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)

Upvotes: 3

John Saunders
John Saunders

Reputation: 161773

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

Upvotes: 1

JaredPar
JaredPar

Reputation: 754515

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

Upvotes: 7

Timothy Carter
Timothy Carter

Reputation: 15785

.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.

Upvotes: 4

Steven Sudit
Steven Sudit

Reputation: 19620

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

edit

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

Upvotes: 1

Related Questions