Click here to Skip to main content
13,458,194 members
Rate this:
Please Sign up or sign in to vote.
Hello, When i using VS to create a c# Project, in the Project file, it always create some folders and files,(Before Debug)


.cs files
A Visual C# Project file has the same name with the Project.

I would like to know:
1, What is this "obj" folder? There is a x86 folder in it and a debug inside x86 folder.

2,What is Visual C# Project file mean (has the same name with the Project).

Thanks, any links will be appreciated,

Posted 27-Dec-12 11:40am
Sergey Alexandrovich Kryukov 27-Dec-12 17:53pm
No, it's not "before Debug". The directories like "Debug" depend on your project settings. This is the parent directory for output directory. This is something you configure yourself. Unlike "obj".
Sergey Alexandrovich Kryukov 27-Dec-12 18:29pm
I just answered both of your questions. They are quite naive, but both are accurately formulated and probably show your intent to get the essence of things. I voted 4. (And this is a very, rarely high vote; look around: the majority of questions these days get a vote of 1, for good reasons.)
Chelseajcole 28-Dec-12 10:47am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

This directory is the only directory use by the build system to place all the intermediate files used for the build. You can remove this directory at any time, or try to do it. As the files are all intermediate, you don't risk to loose anything. However, as the build is usually incremental, the time for build may increase, as some work will be done again. Importantly, deleting of this directory is one of the ways to completely clean-up the project.

Now, as the files are intermediate, you don't need to look into this directory. Well, almost. Sometimes, this is useful to learn how some things work. One example is this: WPF project generates some common code and compiles with that generated code, so it is placed in the "obj" sub-directory. That includes the Main method and some other stuff. In a number of cases, you need to make this code custom by just writing it. Instead of reading the documentation, you can simply find the generated code in "obj" directory and see how it should be written. Got the hint?

Now, the problem about the project file is much more complex; I hardly could answer it in one short post. This is a really advanced standard of project files used to work through MSBuild.exe.
Not only you can use it with Visual Studio, but you can use it on many systems (Linux, Mac OS X) with Mono, you can develop your own build steps ("Tasks") through development of specially designed build assemblies, integrate any custom tools, 3rd-party or your own compilers for different languages (not only those targeting .NET) and a lot more.

Most importantly, you can build any project or solution without Visual Studio. MSBuild, as well as C# and VB.NET compilers comes for free with the (redistributable) .NET Framework. You just need to execute MSBuild <parameters>....

Please see:[^],[^].

First branch of documentation describes programming interface and the rules for the development of the project file, the second one — describes the command-line parameters of just the the MSBuild.exe application. Learning the first one may need considerable effort, but if you need custom of just advanced product build, you can get amazingly neat and highly automated results.


Please also take a look at my past answer; some part of it is related to the topic: How to use cs class in a VB web application[^].

Good luck,
Chelseajcole 28-Dec-12 10:38am
Thank you so mcuh for the answer!!
Sergey Alexandrovich Kryukov 28-Dec-12 12:33pm
You are welcome.
Good luck, call again,
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This should help,[^]
Chelseajcole 28-Dec-12 10:48am
Thanks, that help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03-2016 | 2.8.180323.1 | Last Updated 27 Dec 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100