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?
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 )
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.
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
...
This section is not available anymore. Please use the main Exam Page.70-483 Exam Questions
Log in to ExamTopics
Sign in:
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.
supersunny
Highly Voted 5 years, 11 months agonatsk8freak
5 years, 6 months agoL1am
5 years, 6 months agoBurgSharp
4 years, 11 months agopeter1994
Highly Voted 5 years, 9 months agoMona30
Most Recent 4 years, 9 months agojoaofca
4 years, 9 months agoauderis
4 years, 5 months agoBilal0302
5 years, 3 months agoilCorvo
5 years, 5 months ago