PrepAway - Latest Free Exam Questions & Answers

Which of the following actions will you take to enable tracing for a Web application?

Which of the following actions will you take to enable tracing for a Web application? Each correct
answer represents a part of the solution. Choose all that apply.

PrepAway - Latest Free Exam Questions & Answers

A.
Open the App.config file. Create a new file in the root folder and copy the appropriate XML code
into it if no Web.config file exists.

B.
Set the trace element’s pageOutput attribute to true.

C.
Add a trace element as a child of the system.web element.

D.
Open the Web.config file. Create a new file in the root folder and copy the appropriate XML code
into it if no Web.config file exists.

E.
In the trace element, set the enabled attribute to true.

Explanation:
Tracing is a feature in ASP.NET that enables you to view diagnostic information about a single
request for an ASP.NET page. Tracing allows you to write debug statements directly in your code.
These statements can be retained in your application when it is deployed.
Take the following steps to enable tracing for an application:
1.Open the Web.config file. Create a new file in the root folder and copy the following into it if no
Web.config file exists:
<?xml version=”1.0″? >
<configuration xmlns=”http://schemas.microsoft.com/.NetConfiguration/v2.0″>
<system.web>
</system.web>
</configuration>
2.Add a trace element as a child of the system.web element.
3.In the trace element, set the enabled attribute to true.
4.Set the trace element’s pageOutput attribute to true if you want trace information to appear at
the end of the page that it is associated. Set the pageOutput attribute to false if you want tracing
information to be displayed only in the trace viewer.


Leave a Reply