nerdexam
Microsoft

70-576 · Question #2

You are designing a SharePoint 2010 feature. The feature includes a feature receiver that executes code on activation and deactivation. The feature receiver code interacts with a Web service, which…

The correct answer is B. Wrap your code in a Try-Catch block. See the full explanation below for the reasoning.

Question

You are designing a SharePoint 2010 feature. The feature includes a feature receiver that executes code on activation and deactivation. The feature receiver code interacts with a Web service, which could cause errors beyond your control. You need to ensure that the feature does not activate or deactivate if the Web service causes an error. Which approach should you recommend?

Options

  • AWrap your code in a Try-Catch block.
  • BWrap your code in a Try-Catch block.
  • CWrap your code in a Try-Catch block.
  • DWrap your code in a Try-Finally block.

How the community answered

(52 responses)
  • A
    4% (2)
  • B
    71% (37)
  • C
    10% (5)
  • D
    15% (8)

Community Discussion

No community discussion yet for this question.

Full 70-576 Practice