CSharp > Step by Step - Part1

Compiling the project/solution in CSharp

How to compile the visual studio project/solution?


Any code to run on a machine needs to go through a process called as “Compiling”.

Humans write code in higher level languages like C# and Java but in order that these codes run on hardware machines they need to be converted to “Machine Language”.

The process of converting a higher level language to a machine language is termed as compiling.

Now we can either compile at project level or at solution level. In order to compile a C# solution or project we need to use the “Build Solution” menu as shown in the figure.

You can also compile a single project using “Build Lab1LearnCSharp”.

“Lab1LearnCSharp” is the name of the project.

In the above image of visual studio “Build” menu you can see there is something called as “Build solution”, “Rebuild Solution” and “Clean Solution”. To understand the difference between these three options please go through this youtube video build vs rebuild vs clean solution.

The final compilation goes in to two folders “bin” and “obj”. These folders are present where you source code, solution files and project files are.

You can see these directories by right clicking on the solution and clicking on “Open Folder in File explorer” as shown in the image aside.

“obj” folder has individual binary files of source but they are still not linked. While “bin” folder has the final compiled binaries.

 Views: 679 | Post Order: 5


Write for us






Hosting Recommendations