What's the 'obj' directory for in .NET? [duplicate]

Solution 1:

The "obj" folder is used to store temporary object files and other files used in order to create the final binary during the compilation process.

The "bin" folder is the output folder for complete binaries (assemblies).

Solution 2:

In addition to splattne's answer, I believe the reason for having it (and not cleaning it up after the build) is to support incremental compilation. If you've already compiled 100 classes and change one of them, it's much more efficient to just recompile the code for the one changed class and reassemble the exe/dll from a mixture of the new and old code.

Of course, incremental compilation is a lot more complex than just that - it has to keep track of everything so it can detect when it needs to recompile a class even if that class itself hasn't changed. (e.g. if a new overload becomes available in a class - some callers may need to be recompiled.)