The recipes in this chapter show you how you can locate problems in your ASP.NET applications by using features that support tracing, debugging, and stress testing.
The first six recipes show you how to use tracing to pinpoint the causes of problems in your code. Tracing allows you, through a simple configuration setting or page-level attribute, to have ASP.NET write a whole host of information about the currently executing request to the page or to a trace log. We start by discussing how you initiate page- and application-level tracing. We also show how you can dynamically turn on page-level tracing when an exception occurs. Next, we show you how to make tracing work for components ”those that will run on the web, as well as those that will be used elsewhere. The latter technique is important when you don't want your use of tracing- related code to preclude you from using a component outside of ASP.NET. We also show you how to write trace information to a log file from within a component.
Next we discuss debugging , specifically how setting conditional breakpoints can be a powerful technique for debugging your ASP.NET applications. Setting conditional breakpoints is especially useful for stopping execution at a specific point in iteration-heavy code, the focus of one of this chapter's recipes.
Finally, we take a look at stress testing , using the Application Center Test (ACT) tool, which is available to users of the Enterprise Architect and Enterprise Developer Editions of VS.NET. With ACT, you can fairly easily stress test a web application or service, which is especially useful when scalability is a key goal of your project. The last recipe in the chapter discusses how you might use this tool to analyze the performance of a simple web service.
The recipes in this chapter are intended to help remove some of the mystery of tracing and debugging, and, in the process, help you use these techniques earlier in the development cycle when problems are often less costly to fix.