exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 26 discussion

Actual exam question from Microsoft's 70-483
Question #: 26
Topic #: 2
[All 70-483 Questions]

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
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
✑ 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
)

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
supersunny
Highly Voted 5 years, 11 months ago
B. is the correct answer. Check it out.
upvoted 13 times
natsk8freak
5 years, 6 months ago
Definitely B: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.xmlwritertracelistener?view=netframework-4.8
upvoted 5 times
L1am
5 years, 6 months ago
Why not D? D also works
upvoted 1 times
BurgSharp
4 years, 11 months ago
EventLog works only when run as admin
upvoted 1 times
...
...
...
...
peter1994
Highly Voted 5 years, 9 months ago
D is the correct answer.
upvoted 8 times
...
Mona30
Most Recent 4 years, 9 months ago
B: XmlWriterTraceListener
upvoted 1 times
...
joaofca
4 years, 9 months ago
It can't be B because B would not compile. It uses itself inside it's own contructor initialization. What came first? the egg or the chicken? I would go for D because it works and you dont need to run it as admin as long as you dont need to create a new source.
upvoted 1 times
auderis
4 years, 5 months ago
Constructor?
upvoted 1 times
...
...
Bilal0302
5 years, 3 months ago
D or B?
upvoted 1 times
...
ilCorvo
5 years, 5 months ago
D is not the right answer because you need to run the application as an administrator: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.eventlog?view=netframework-4.8
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...