In fact, this article mainly describes how to use trace at two application levels:
GenerallySet a breakpoint for tracking, Or bothManually generate variable output debugging bugThis will not only waste time, but also
Sometimes you forget to delete your own variables.
. NET provides the trace class,This problem can be effectively solved.
tracing debugging
tracking:
1. page-level tracking:
the following page commands are included at the beginning of the page: <% @ page trace = "true" tracemode = "sortbycategory/sortbytime" %>
Custom message:
trace. write ("here is the string to be displayed");
trace. warn ("here is the string to be displayed"); // with trace. write is the same, but the font is red
check whether trace is used
example: If (trace. isenabled) {trace. warn ("tracking enabled")}
2. ApplicationProgramLevel tracking:
In the <system. Web> section of the web. config file, <trace enabled = "true" pageoutput = "true"/>
Summary:
Such a statement trace. Write ("here is the string to be displayed"); like a comment, vs. Net does not compile it even if it is not deleted.