Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hello, When i using VS to create a c# Project, in the Project file, it always create some folders and files,(Before Debug)

Folders:
bin
obj
Properties


Files:
.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,

ChelseaJCole
Posted
Updated 17-Sep-18 3:07am
Comments
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".
—SA
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.)
—SA
Chelseajcole 28-Dec-12 10:47am    
Thanks

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:
http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx[^],
http://msdn.microsoft.com/en-us/library/vstudio/ms164311.aspx[^].

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.

[EDIT]

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,
—SA
 
Share this answer
 
v5
Comments
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,
—SA
This should help,

http://bit.ly/YRlb8K[^]
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900