What is with all of the files for a simple program?
- I posted this in the IDE section but got no reply so I am trying it here.
I am just learning C# and made a solution for a command line program. I would like to know what the heck all of these output files are for and can I somehow force them not to make subdirectories. I was able to remove the bin directory but not the obj\Debug etc. directory. Also don't understand the Test.vshost.exe file and the duplicated Test.exe and Test.pdb files.
\---Test
| Test.sln
|
\---Test
| Program.cs - Main Program
| Test.csproj - Project
|
+---bin
| \---Debug
| Test.exe - Executable
| Test.pdb - program database for debugging
| Test.vshost.exe - WHAT IS THIS FOR?
|
+---obj
| | Test.csproj.FileList.txt - WHAT IS THIS FOR?
| |
| \---Debug
| | Test.exe - WHAT IS THIS FOR, duplicate?
| | Test.pdb - WHAT IS THIS FOR, duplicate?
| |
| \---TempPE - WHAT IS THIS FOR?
\---Properties
AssemblyInfo.cs - Optional Assembly Information- Moved byPeter RitchieMVP, ModeratorFriday, June 20, 2008 4:45 PMbetter
Answers
Hi, conrarn
AFAIK
Why duplicate?
Because the "bin" folder is the output folder for complete binaries whereas the "obj" folderis used to store temporary object files and other files used to create the final binary.
Test.csproj.FileList.txt -- Simply a list text, named ProjectName.ProjectType.FileList.txt
Test.pdb -- A program database (PDB) file holds debugging and project state information that allows incremental linking of a debug configuration of your program.
Test.vshost.exe -- The hosting process is a feature in VS 2005 that improves debugging performance, enables partial trust debugging, and enables design time exp evaluation. The hosting process files contain vshost in the file name and are placed in the output folder of your project.
more details: http://msdn2.microsoft.com/en-us/library/ms242202(VS.80).asp
Thank you
All Replies
Hi, conrarn
AFAIK
Why duplicate?
Because the "bin" folder is the output folder for complete binaries whereas the "obj" folderis used to store temporary object files and other files used to create the final binary.
Test.csproj.FileList.txt -- Simply a list text, named ProjectName.ProjectType.FileList.txt
Test.pdb -- A program database (PDB) file holds debugging and project state information that allows incremental linking of a debug configuration of your program.
Test.vshost.exe -- The hosting process is a feature in VS 2005 that improves debugging performance, enables partial trust debugging, and enables design time exp evaluation. The hosting process files contain vshost in the file name and are placed in the output folder of your project.
more details: http://msdn2.microsoft.com/en-us/library/ms242202(VS.80).asp
Thank you
- Why do you want to stop it from using subdirectories for the output?
How would you handle the different release and debug builds if you have only a single output folder?
Anyway, to change the output folders (..\bin\..) go to your project properties, click the "Build" tab, and change the "Output Path" value. There is a different "Output Path" value for each configuration, which you select from the "Configuration" dropdown at the top of the properties page.
(Configurations will be "debug" and "release" by default.)
However, my advice is: Do not change this! Figo Fei - MSFT wrote: Test.vshost.exe -- The hosting process is a feature in VS 2005 that improves debugging performance, enables partial trust debugging, and enables design time exp evaluation. The hosting process files contain vshost in the file name and are placed in the output folder of your project.
more details: http://msdn2.microsoft.com/en-us/library/ms242202(VS.80).asp
Thank you
Thanks for you help.
Matthew Watson wrote: Why do you want to stop it from using subdirectories for the output?
How would you handle the different release and debug builds if you have only a single output folder?
Anyway, to change the output folders (..\bin\..) go to your project properties, click the "Build" tab, and change the "Output Path" value. There is a different "Output Path" value for each configuration, which you select from the "Configuration" dropdown at the top of the properties page.
(Configurations will be "debug" and "release" by default.)
However, my advice is: Do not change this!The executables I will be making will be very large. Duplicates of code is just plain, well, lets just say inefficienct. Why would I want to change the directory structure? Now you are showing your age. I grew up on VAX's, etc. and still prefer the command line, which by the way, is faster than using a GUI if you are familiar with the command line. Next, I work in Debug and when everything is working, I recompile to Release. Next a I run a simple script to "cleanup" the directory of the obj, pdb, etc. files that are no longer required. Believe it or not, we didn't use to have the large disks that we have today so leaving files that aren't required around is well, again, lets just say inefficient.
I appreciate your feedback but if you would have read the question a little bit more closely you would have saved yourself some time as I stated I know how to change the "Output Path", it was the temporary directory output that I wanted to change which there seems to be no option to change.
Again thanks for you help.
>>>I appreciate your feedback but if you would have read the question a little bit more closely you would have saved yourself some time as I stated I know how to change the "Output Path",
You said "I was able to remove the bin directory". If what you really meant was that you were able to change the output path, why didn't you say so? Your inability to express yourself correctly has wasted some of my time, hasn't it?
>>Now you are showing your age. I grew up on VAX's, etc. and still prefer the command line, which by the way, is faster than using a GUI if you are familiar with the command line.
Showing my age? How patronising! I've been programming professionally since 1981... Sheesh.
For our builds, we use MSBUILD which, for your information, is command-line driven. It uses the CSProj files created from the IDE.
Using the command-line versus using the IDE, and using separate folders for release/debug builds are orthogonal concepts; I don't know why you think they are related.Sorry for being "patronising".
And again, you need to read the question. The bin directory is the default output path. Don't get so pissed off when you make a mistake.
Now about "orthogonal concepts". I build both from the IDE and the command line. Everything else is more or less from the command line. So I I want to run from the directory inwhich the solution resides. That means I have to hunt for the output. Now since the output contains both DLL's and EXE, I prefer not to add the location of the outputs to the path and instead put everything in my working directory so the DLLs and EXE are found when my tools are executed.
Next time, keep an open mind. Just because you believe everyone is a dumb *** doesn't mean they are.
- I didn't think you were a "dumbass". I just think you're an unpleasant fellow.
Matthew Watson wrote: Why do you want to stop it from using subdirectories for the output?
How would you handle the different release and debug builds if you have only a single output folder?
Anyway, to change the output folders (..\bin\..) go to your project properties, click the "Build" tab, and change the "Output Path" value. There is a different "Output Path" value for each configuration, which you select from the "Configuration" dropdown at the top of the properties page.
(Configurations will be "debug" and "release" by default.)
However, my advice is: Do not change this!How is one supposed to intepret this? You recommend that I should not because you believe that it is incorrect. The original question was very straight forward and did not require your opinion whether it should be done or not. That is my choice. Hence, you believe what I was doing is dumb. Maybe you did not intend that when you wrote the reply but I read it that way.
Thanks for opinion. Too bad I still haven't figured a way to change temporary build directories (not the output directory).
This post explains a little bit on changing the OBJ directory, if that is what you are trying to do. There is still an OBJ\TEMPPE directory created though.
http://forums.msdn.microsoft.com/en-US/msbuild/thread/ffe9aa24-9fe6-4c53-881e-49a74f6e1055/
I'm adding this to my .csproj file, which gets me 99% of the way there:
<BaseIntermediateOutputPath>$(SolutionDir)..\$(SolutionName)Bin\$(MSBuildProjectName)\obj</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(SolutionDir)..\$(SolutionName)Bin\$(MSBuildProjectName)\obj</IntermediateOutputPath>
<OutDir>$(SolutionDir)..\$(SolutionName)Bin\$(MSBuildProjectName)\obj</OutDir>
<OutputPath>$(SolutionDir)..\$(SolutionName)Bin\$(MSBuildProjectName)\bin\$(Configuration)</OutputPath>
Cheers,- 18 months too late, I fear...
- 18 months too many!
Anyways for other .Net enthusiasts... brethren if you come peeping around with a similar problem as conrarn did.... a small hint .. do some poking into MSBuild.exe and/or NAnt beforehand.
Links:
http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx for MSBuild.exe concepts
http://nant.sourceforge.net for NAnt- Edited byDave Mansell Wednesday, July 02, 2008 11:32 AMlinks added
- No way to avoid the creation of the empty obj/Release/tempPE path?
Andrea- Edited byAndreaPlanet Saturday, August 30, 2008 12:26 AMtypoo error
- just use csc.exe and all you get is your dll. Easy.
Potential Development Genius - Rich Hanbidge MSFT said:
This post explains a little bit on changing the OBJ directory, if that is what you are trying to do. There is still an OBJ\TEMPPE directory created though.
http://forums.msdn.microsoft.com/en-US/msbuild/thread/ffe9aa24-9fe6-4c53-881e-49a74f6e1055/
I'm adding this to my .csproj file, which gets me 99% of the way there:
<BaseIntermediateOutputPath>$(SolutionDir)..\$(SolutionName)Bin\$(MSBuildProjectName)\obj</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(SolutionDir)..\$(SolutionName)Bin\$(MSBuildProjectName)\obj</IntermediateOutputPath>
<OutDir>$(SolutionDir)..\$(SolutionName)Bin\$(MSBuildProjectName)\obj</OutDir>
<OutputPath>$(SolutionDir)..\$(SolutionName)Bin\$(MSBuildProjectName)\bin\$(Configuration)</OutputPath>
Cheers,
Could you post an example csproj file?
I agree with Dave Mansell, 18 months too many!!!!


