nerdexam
Microsoft

70-573 · Question #138

You create a Web Part that contains the following logging code. (Line numbers are included for reference only.) 01Try 02 ... 03Catch ex As Exception 04…

The correct answer is A. Run the code segment at line 05 inside a RunWithElevatedPrivileges delegate. See the full explanation below for the reasoning.

Question

You create a Web Part that contains the following logging code. (Line numbers are included for reference only.) 01Try 02 ... 03Catch ex As Exception 04 05System.Diagnostics.EventLog.WriteEntry("WebPart Name", ("Exception Information: " + ex.Message), EventLogEntryType.Error) 06End Try You discover that line 05 causes an error. You need to resolve the error. What should you do?

Options

  • ARun the code segment at line 05 inside a RunWithElevatedPrivileges delegate.
  • BAdd the following code at line 04.
  • CAdd the following code at line 04
  • DChange line 05 to the following code segment.

How the community answered

(58 responses)
  • A
    78% (45)
  • B
    14% (8)
  • C
    3% (2)
  • D
    5% (3)

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice