In my VS 2013 C# Windows Forms app, its "issue" (the .exe) appears in both the \bin\Debug folder and the \obj\Debug folder. Same date, same size. Why is it output to both places? Why is that necessary?
Asked
Active
Viewed 2,642 times
3
-
1What problem are you experiencing with it being in both places? – Erik Philips Nov 20 '15 at 00:14
-
1Only a mental problem (so far, anyway). – B. Clay Shannon-B. Crow Raven Nov 20 '15 at 00:14
-
I'm not sure how on-topic this question is. It certainly is a interesting question, but it doesn't actually solve a problem. – Erik Philips Nov 20 '15 at 00:17
-
related: http://stackoverflow.com/questions/172279/what-is-obj-folder-generated-for – Gus Nov 20 '15 at 00:19
-
1Possible duplicate of [What are the obj and bin folders (created by Visual Studio) used for?](http://stackoverflow.com/questions/5308491/what-are-the-obj-and-bin-folders-created-by-visual-studio-used-for) – Erik Philips Nov 20 '15 at 00:19
-
Out of curiosity, what was the problem in having a duplicate of the exe file? – KnightFox Nov 20 '15 at 06:05
-
@KnightFox: A seeming violation of the DRY principle. – B. Clay Shannon-B. Crow Raven Nov 20 '15 at 13:42
2 Answers
5
obj\Debug
is the "working" folder that is used for the output of csc.exe
(the .NET compiler). Once the file is compiled it is copied to the "output directory" which is by default bin\Debug
and bin\Release
.
You can change the output folder by editing the project properties, you can not change the compilers working directory to the best of my knowledge (but that does not mean it can't be done).

Scott Chamberlain
- 124,994
- 33
- 282
- 431
4
Msbuild has parameters for output folder(bin/debug) as well as IntermediateOutputPath( and BaseIntermediateOutputPath)
The output is usually your bin folder while the IntermediateOutputPath points to your obj folder that is used for temporary storage before generating your final binary. Look at common ms build properties for more information.

KnightFox
- 3,132
- 4
- 20
- 35