- Shopping Bag ( 0 items )
Debugging ASP.NET focuses on the various tools, techniques, and best practices associated with debugging ASP.NET web applications under Microsoft's new .NET platform. Brief descriptions of the problems with debugging previous versions of ASP are covered, as well as how the new features of ASP.NET can be exploited to their fullest to find and eliminate bugs quickly and easily. The book will introduce changes to the code structure paradigm as implemented in the .NET platform, and how to structure ASP.NET code in ...
Debugging ASP.NET focuses on the various tools, techniques, and best practices associated with debugging ASP.NET web applications under Microsoft's new .NET platform. Brief descriptions of the problems with debugging previous versions of ASP are covered, as well as how the new features of ASP.NET can be exploited to their fullest to find and eliminate bugs quickly and easily. The book will introduce changes to the code structure paradigm as implemented in the .NET platform, and how to structure ASP.NET code in this new paradigm to enable faster web application debugging.
In this chapter, you will be looking at all the features available for debugging in the Visual Studio .NET IDE, how to use them, and where each one is applicable for the problem you might be trying to conquer. This will all be accomplished by building a project from scratch in the IDE, so we recommend creating the project on your own as it is done in this chapter.
Under the Debug menu you will find the Processes selection. Clicking this brings up the dialog box in Figure 7.6.
By default, you will see only the processes that you have started in some way. If you click the Show System Processes check box, you have access to everything that is running on the current machine. Click the process to be debugged, and then click the Attach button. Now, if that process hits a breakpoint or any other type of debugger event, that event pops up in the Visual Studio .NET IDE.You can also force the program to break by clicking the Break button at the bottom of the window. At any time, you can stop debugging the process by clicking the Detach button.Terminate kills the process altogether.
After clicking the Attach button, you are given a choice of what type of debugging you want to do on the process you've selected. Figure 7.7 shows an example of this dialog box.
Take a look at the web.config file contained in your project.This is an XML file that contains specific configuration information for your ASP.NET project. One line in this file will look similar to the following:
<compilation defaultLanguage="vb " debug=="true " //>
The defaultLanguage parameter will be based on the default language of your ASP.NET project. But what we are concerned about here is the debug parameter. If you are running in a debugging environment and want to be able to access the spiffy features of the Visual Studio .NET IDE, this debug parameter must be set to true , as it is in the previous line. If it is set to false , none of the features will work.This is what you want for a release build of your project.
This sample project will consist of an ASP.NET page and a Visual Basic .NET/C# component so that you can see how easily the two interact and how they can be debugged simultaneously. The project itself will simply ask the user for a valid email address and then send a form letter to that address. Start out by creating the project. We called ours Chap5Visual Basic for the Visual Basic .NET version and Chap5CS for the C# version.
The first thing to do is create the ASP.NET page that the user will see. Listing 7.1 contains the main ASP.NET page that contains the input form on which the user can enter the email address where the mail will be sent. Here the page name is left as WebForm1 , the default name provided when the project was created....
|I||ASP Debugging Basics||1|
|Understanding Server-Side Events||3|
|New Language Options||7|
|2||Traditional Approaches to Debugging in ASP||9|
|Structure of Pre-ASP.NET Pages||9|
|Problems and Shortcomings||13|
|Old Strategies That Still Do the Job Well||14|
|An ASP Debug Object||16|
|Divide and Conquer||29|
|Simple Before Complex||32|
|Turtle Makes the Wiser||36|
|4||Code Structure That Eases Debugging||39|
|Structured Exception Handling||58|
|Global Exception Handling||59|
|II||ASP.NET Debugging Tools||67|
|What Is Conditional Compiling?||69|
|Other Preprocessor Directives||76|
|Setting Trace Messages||85|
|Tracing via Components||93|
|Tips for Using Trace Information||95|
|7||Visual Studio .NET Debugging Environment||97|
|Introduction to Features||97|
|Attaching to Processes||101|
|Setting It All Up||103|
|Inline Debugging of ASP.NET Pages||103|
|Inline Debugging of Components||111|
|8||Leveraging the Windows 2000 Event Log||119|
|The Windows 2000 Event Log Defined||119|
|Web Applications Can Use the Event Log||120|
|The System.Diagnostics Event Log Interface||120|
|Custom Event Logs||121|
|Handling Different Types Of Events||124|
|Access Event Log Data via the Web||129|
|III||Debugging the New ASP.NET Features||139|
|9||Debugging Server-Side Controls||141|
|Creating the Project||142|
|Debugging the Control||151|
|10||Debugging Data-Bound Controls||157|
|11||Debugging User Controls||173|
|User Control Basics||174|
|Adding Properties and Methods||175|
|Dynamic User Controls||184|
|12||Caching Issues and Debugging||189|
|The Caching API||196|
|IV||Debugging Related Technologies||201|
|13||Debugging Web Services||203|
|Web Services Stumbling Blocks||203|
|Problems Working with XMLSerializer||214|
|Working with Errors in SOAP||215|
|Error Returning Certain Types of Data||219|
|Working with Streams||220|
|Basic Web Services Debugging||226|
|Problems Deploying Your Web Service?||230|
|14||Debugging .NET Components and HttpHandlers||231|
|.NET Components Versus Registered COM Components||249|
|Understanding the System.Data Namespace||275|
|Catching SQL Errors||275|
|New Connection Components||280|
|Issues with the DataReader Class||281|
|Working with Transactions||281|
|Error Codes and How to Debug Them||284|
|SQL ADO.NET Objects Versus OleDb ADO.NET Objects||300|
|A||Issues That Arise When Migrating from ASP to ASP.NET||305|
|Moving from ASP to ASP.NET||305|
|Moving from VBScript to Visual Basic||311|
|Opting for C#||318|
Posted November 30, 2001
This book will save experienced, as well as newbies a lot of time debugging ASP.NET, as well as ADO.NET, Server Controls, COM+ interop, pretty much anything you can do with .NET. Good coverage of VB.NET as well as C#. I did not realize that VB.NET, and C# had different error messages. This book explains the different messages as well as strategies for avoiding them in the first place. All in all this book will save you a lot of time, much more than the book costs. A must have for any serious developer.Was this review helpful? Yes NoThank you for your feedback. Report this reviewThank you, this review has been flagged.
Posted November 8, 2001
I have to say that even though the book says that its for intermediate to experienced programmers it really should say that it is for beginners to intermediate programmers. I say that because a lot of debugging skills suggested in this book come with experience to advanced programmers. However this book does list a whole bunch of gotcha's when using not just ASP.NET, but also some of the advanced features of ASP.NET like User Controls and Caching, Http Handlers, etc. This books also lists some pitfalls to be aware of when using Serviced Components (COM+). These features would be useful for Beginners or Intermediates but the Advanced developers of ASP.NET would already be familiar with some of the techniques listed like Tracing, Conditional Compiling, writing to the event log etc. I would recommend that if you are new to ASP.NET and have just finished reading a book on ASP.NET, pick this book up next to read about some gotcha's when using ASP.NETWas this review helpful? Yes NoThank you for your feedback. Report this reviewThank you, this review has been flagged.
Posted January 15, 2002
This book is an excellent book for ASP Programmers. Excellent book that introduce you to ASP.Net concepts w/ applicable examples. Interesting approach to introduce microsoft's new platform to developers. Easy, couple-nights reading before bed.Was this review helpful? Yes NoThank you for your feedback. Report this reviewThank you, this review has been flagged.