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
)
B is correct.
C is wrong, because the second argument is source name, not message
2
0
B is correct. C is wrong because of what you said and XmlWriterTraceListener.TraceEvent method has 5 arguments, not 4.
https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.xmlwritertracelistener.traceevent?view=netframework-4.8
1
0