What should you do?

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

01 SPSite siteCollection = new SPSite(“http://moss”);
02 UserProfileManager profileManager = new UserProfileManager(ServerContext.GetContext(siteCollection));
03 UserProfile profile = profileManager.GetUserProfile(“domain\\username”);
04 SPSite personalSite = 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?

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

01 SPSite siteCollection = new SPSite(“http://moss”);
02 UserProfileManager profileManager = new UserProfileManager(ServerContext.GetContext(siteCollection));
03 UserProfile profile = profileManager.GetUserProfile(“domain\\username”);
04 SPSite personalSite = 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?

A.
Remove line 06.

B.
Add the following line of code at line 05:
personalSite.close();

C.
Add the following line of code at line 05:
personalSite.Dispose();

D.
Change line 06 to the following code segment:
siteCollection.close();

Explanation:
MNEMONIC RULE: “Dispose”

Disposing Objects
http://msdn.microsoft.com/en-us/library/ee557362.aspx



Leave a Reply 1

Your email address will not be published. Required fields are marked *


Sumer

Sumer

hi,

are these dumps still valid for sharepoint 70-573 exam?