25

I have a very basic question.

When we compile a VS 2005 C# application, it creates two folders. One is a bin folder and another one is an obj folder. Does anyone know why it creates an obj folder? I tried to find out the docs for it but I could not find it...

David Ferenczy Rogožan
  • 23,966
  • 9
  • 79
  • 68
MAC
  • 6,277
  • 19
  • 66
  • 111
  • 4
    Might be a good idea to edit the title of your question so it more clearly reflects its content. Perhaps something like what are the bin and obj directories for? – jpoh Jul 06 '09 at 06:19

2 Answers2

60

The bin\ folder holds the results of the build: the binaries to distribute or archive, the XML documentation file, necessary dependencies and debug symbols.

The obj\ folder contains temporary files created during compilation. They are preserved so for an incremental build, the compiler can skip individual source files if they haven't changed and use the temporary files instead. That's faster :)

peterchen
  • 40,917
  • 20
  • 104
  • 186
  • 1
    I Would like to add reference an third party assembly (.dll) to my project , where should I put it and then reference it in order when i move my project it doesn't break the reference ? – Mostafa Oct 08 '11 at 15:50
  • Try creating an `/External Reference` folder in your project, and reference there. This way the folder will stay with your project and won't be ignored by the versioning system. – Robotronx Apr 01 '17 at 12:53
8

Devenv will compile whatever projects you have configured for debugging using the appropriate compilers.

The compilers create obj directories as a temporary files.

bin will contain a folder for each of your solution configuration (debug is the default) which contains the build outputs for your project.

Spence
  • 28,526
  • 15
  • 68
  • 103