nerdexam
Microsoft

70-573 · Question #144

You create a console application to manage Personal Sites. The application contains the following code segment. (Line numbers are included for reference only.) 02 Dim profileManager As New…

The correct answer is C. Add the following line of code at line 05. MNEMONIC RULE: "Dispose" Disposing Objects

Developing SharePoint Solutions

Question

You create a console application to manage Personal Sites. The application contains the following code segment. (Line numbers are included for reference only.) 02 Dim profileManager As New serProfileManager(ServerContext.GetContext(siteCollection)); 03 Dim profile As UserProfile = profileManager.GetUserProfile("domain\username"); 04 Dim personalSite As SPSite = profile.PersonalSite; 05 06 siteCollection.Dispose(); You deploy the application to a SharePoint site.After deploying the application, users report that the site loads slowly. You need to modify the application to prevent the site from loading slowly. What should you do?

Options

  • ARemove line 06.
  • BAdd the following line of code at line 05.
  • CAdd the following line of code at line 05.
  • DChange line 06 to the following code segment.

How the community answered

(52 responses)
  • A
    4% (2)
  • B
    10% (5)
  • C
    83% (43)
  • D
    4% (2)

Explanation

MNEMONIC RULE: "Dispose" Disposing Objects

Topics

#SPSite disposal#memory management#UserProfileManager#Personal Sites

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice