Library tutorials & articles
High-Performance .NET Application Development & Architecture
- Introduction
- Planning
- Application/Server Security
- IIS Security
- Web.Config or ASP.NET Security
- ADO.NET Security
- Code Security
- General .NET Best Practices
- Directory Structure
- Presentation / Business Layer
- Data Access Layer
- Common ADO.NET Scenarios
- Error Trapping & Handling
- Debugging
- Tracing
- Common .NET Errors
- Performance Testing
- Conclusion
Tracing
Tracing in .NET is another means of debugging, but allows you to insert custom statements added to your page's output, whereby you can "trace" the flow of your code and determine the order of things at run time. Tracing, contrary to debug mode, presents you with a lot of information about your page. It further can help much in ascertaining any performance issues concerning your code. In any event, like debugging, tracing could be implement the same two ways:
- Application wide via the web.config file:
<system.web>
<trace enabled="true"/>
</system.web>
- Or locally within each page's @ Page Directive:
<%@ Page Trace="true" TraceMode="SortByTime | SortByCategory" %>
And within your code you would trace by writing:Trace.Write("Tracing has started")
Trace.Warn("Examine more closely here")
Trace.Write("Tracing has ended")
Trace. Write produces standard output, whereas using Trace.Warn would output your text in red for added notice. And bear in mind that the best place to Trace is usually before and after any major code sections, i.e. Datagrid binding, editing, etc.
With all this error handling now under our belt, what happens now when an error does occur? How do we fix it? Well, next we'll look at some common, though not basic, .NET system errors.
Related articles
Related discussion
-
High-Performance .NET Application Development & Architecture
by Manjot Bawa (0 replies)
-
hey developers out there
by pitsophera (0 replies)
-
An Introduction to VB.NET and Database Programming
by carlosmen (14 replies)
-
Using ADO.NET with SQL Server
by Manjot Bawa (23 replies)
-
Compatibility Issue on Firefox to display on Cursor Location
by dinc3r (1 replies)
Related podcasts
-
ADO.NET "Astoria" Data Services with Shawn Wildermuth
Scott chats with Shawn Wildermuth, "the ADO Guy," about ADO.NET Data Services, aka "Project Astoria." It's REST for SQL Server. Should you care? What's REST? How does this relate to WCF or ASP.NET?
Events coming up
-
Nov
18
15 Minutes of Fame
Dresher, United States
This is a yearly tradition. We select 10 of the favorite speakers from monthly meetings, code camps, and hands on labs. Each one does a 15 minute talk on their favorite .NET technology. This is our 10th anniversary so we plan a gala event with special prizes and refreshments.
http://bit.ly/izsu9 .....The new VSTS enables you to convert your imagination into the perfect material images on screen ! Let your mind do the thinking and VSTS will do the rest
!--removed tag-->