Which code should you insert at line 28?

You have the following code (line numbers are included for reference only):

You need to ensure that if an exception occurs, the exception will be logged.
Which code should you insert at line 28?

You have the following code (line numbers are included for reference only):

You need to ensure that if an exception occurs, the exception will be logged.
Which code should you insert at line 28?

A.
Option A

B.
Option B

C.
Option C

D.
Option D

Explanation:
* XmlWriterTraceListener
Directs tracing or debugging output as XML-encoded data to a TextWriter or to a Stream,
such as a FileStream.
* TraceListener.TraceEvent Method (TraceEventCache, String, TraceEventType, Int32)
Writes trace and event information to the listener specific output.
Syntax:

[ComVisibleAttribute(false)]
public virtual void TraceEvent(
TraceEventCache eventCache,
string source,
TraceEventType eventType,
int id
)



Leave a Reply 9

Your email address will not be published. Required fields are marked *


JaneDoe

JaneDoe

Both answers B and C are correct.

kasp

kasp

I agree, in 120 the correct is C(of this question) but in 160 the correct is B(of this question)

AW

AW

B: Correct
C: Cannot access protected property HResult

Fippy Darkpaws

Fippy Darkpaws

Confirmed. Both B and C produce legitmate logs and satisfy the requirement.

PaulC

PaulC

BC

tested in VS2013

Marina

Marina

B writes:

0
3
0
8

Marina

Execution is too long > Delay(5000) > 9710.3141

C writes:

2148734208
3
0
2

Marina

So most correct is C (logs error, not information)

Marina

Marina

OMG, sorry for the previous, parser killed my xml.
C writes:
SubType Name=”Error”
Source Name=”Execution is too long > Delay(10) > 12982.3068″
B writes:
SubType Name=”Information”
Source Name=”Trace”

j

j

Question 120 – was B
Here C