When you are programming C# in Visual Web Developer, I recommend that you compile your source code periodically to ensure that you are on the right track and don’t have any syntax errors in your code. Normally, when you click the play button at the top as we did in the previous lessons, the Visual Web Developer software will automatically compile the project for you before it runs the web site. There will be situations where you don’t want to run the program yet, but just want to execute the compiler to check for syntax errors. A good example is the situation where you are not finished coding a particular set of code, but need to check the syntax.
**For beginning programmers I recommend that you check your syntax very often by executing the compiler. This is so that you can fix problems before your program becomes too large and then it will be harder to fix since there is more code to examine for problems. It is much easier to fix syntax errors incrementally. Although I say that this recommendation is especially for beginning programmers, I personally still perform syntax checks periodically as I code for the reasons mentioned here; it just makes the overall programming process go much smoother.
To execute the compiler without running the project, right click on the project name in the Solution Explorer and choose the Build Web Site option. The compiler will open an Output window at the botton of the code editor window and you should see something similar to “Build: 1 succeeded or up-to-date, 0 failed, 0 skipped”. Notice that it says “succeeded” which lets you know that you did not have any compile errors. Click here to watch the sample video. In the next lesson we will discuss how to fix compiler errors.