Compiling Projects

Compiling a project (or building, in Visual Studio terminology) is the process that produces a .NET assembly starting from the project and source code (see Chapter 1, “Introducing .NET 2015”). An assembly can be a standalone application (an .exe assembly) or a .NET class library (a .dll assembly). To compile a project into an assembly, you need to click Build, Build ProjectName, where ProjectName is the name of your project. When you invoke this command, Visual Studio launches the Visual Basic command-line compiler (Vbc.exe) and provides this tool all the necessary command-line options. For solutions that contain different kinds of projects, Visual Studio launches MSBuild.exe, a command-line utility that can compile entire solutions containing several projects written in different languages and of different types. At the end of the build process, Visual Studio shows a log inside the Output window. Figure 2.25 shows the output log of the build process for the MyFirst2015Program sample application.

Image

FIGURE 2.25 The Output window shows the compilation process results.

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 are notified of the errors that the compiler found. The Error List window shows a complete list of error messages and warnings and enables you to easily understand where the errors happened by double-clicking the error message. This operation redirects you to the code that generated the error. The executable (or executables, if the solution contains more than one project) will be put in a subfolder within the project’s directory, called BinDebug or BinRelease, depending on the output configuration you chose. 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
3.20.224.107