Compiling Projects

Compiling a project (or building according to the Visual Studio terminology) is the process that produces a .NET assembly starting from your project and source code (according to the .NET architecture described in Chapter 1, “Introducing the .NET Framework 4.0”). An assembly can be a standalone application (.exe assembly) or a .NET class library (.dll assembly). To compile your project into an assembly you need to click the Build command in the Build menu. Notice that the Build command is followed by the name of your project. When invoking this command, Visual Studio launches, behind the scenes, the Visual Basic command-line compiler (Vbc.exe) and provides this tool all the necessary command-line options. For solutions containing different kinds of projects, Visual Studio launches the MSBuild.exe command-line utility that can compile entire solutions containing several projects written in different languages and of different types. MSBuild is discussed in Chapter 51, “Advanced Compilations with MSBuild.” At the end of the build process, Visual Studio shows a log inside the Output window. Figure 2.23 shows the output log of the build process for the MyFirst2010Program sample application.

Figure 2.23 The Output window shows the compilation process results.

image

The compilation log shows useful messages that help you understand what happened. In this case there were no errors, but in situations in which the compilation process fails because of some errors in the code, you will be notified of what errors were found by the compiler. The Error List window shows a complete list of error messages and warnings and enables you to easily understand where the errors happened by simply double-clicking the error message. This operation redirects you to the code that generated the error. The executable (or the executables, in case of more than one project in the solution) will be put in a subfolder within the project’s directory, called BinDebug or BinRelease, depending on the output configuration you choose. Configurations are discussed next.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.132.123