HTML and CSS Reference
In-Depth Information
Building and debugging an application
You write the source code for an application in the context of a Visual Studio solution.
A solution is the repository of all resources required for the application to work: source files,
images, style sheets, manifest, and so forth.
Having a solution is not the same as having an application; but you can create an executable
application from a solution by successfully “building” (compiling) the solution. To build the
current solution in Visual Studio, press F7 or select the Build Solution option from the Build
menu, as shown in Figure 6-11. During the build, the Visual Studio environment invokes
the compiler and processes your source code. If everything is OK and no syntax errors are
detected, you wind up with an executable application that you can launch.
FIGURE 6-11 The Build menu.
When Visual Studio discovers errors during the build step, it lists them for you in a window
at the bottom of the Visual Studio environment. However, when you build a JavaScript
application (as in this topic), it's unlikely that you will get errors during the build process. It's
much more likely that you will get run time errors .
Run time errors show up during the debugging phase. The debugging phase is all about
running the application to see if it does what it is supposed to do. You start debugging the
application by hitting F5 or selecting the Start Debugging option from the Debug menu.
Figure 6-12 shows the effect of a syntax error: a comma is missing right before the
highlighted line. Note that the message you receive may be a bit misleading about the real
causes of the problem. In the figure, Visual Studio seems to indicate that the code is missing
a closing bracket. That is definitely a possibility, but it is not the real issue with the code in the
figure. The point is that, in general, while you must pay attention to the fact that there is an
error, you should take the specific error messages that appear with a grain of salt, because they
are “automatic guesses” that the software makes, and don't always reflect the true underlying
problem.
Search WWH ::




Custom Search