Summary

Conditional compiling is extremely easy to implement, with tremendously powerful results. This chapter looked at two different ways to accomplish a similar task: through preprocessor directives and via function attributes. The key difference here is that by using the Conditional function attribute, the debug code is compiled into the application; however, it is never executed. By using the preprocessor directives of this section, the code is never compiled into the application—therefore, it could never be executed.

Next, you looked at some other preprocessor compiler directives and how they can provide additional information to aid you in debugging your ASP.NET applications.

By adding some conditional compiling to your code, you will be able to add a robust debugging interface to your application and immediately remove it from the production-level output at the proverbial flip of a switch.

In the next chapter, you will start to look at the built-in .NET tracing facilities and how they can help you explore what is happening inside your application as it is running, both in a debug and a production environment.

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

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