You need to ensure that each time the workflow starts, the three activities are linked to a single task
You plan to create a workflow that has the following three activities: CreateTask —
OnTaskChanged CompleteTask You need to ensure that each time the workflow starts, the three
activities are linked to a single task. What should you do?
Which code segment should you add at line 04?
You need to disable the CriticalExceptionCount measure for all user solutions. You write the
following code segment. (Line numbers are included for reference only.) 01 Dim userCode As
SPUserCodeService = SPUserCodeService.Local 02 Dim measures As
SPResourceMeasureCollection = userCode.ResourceMeasures 03 Dim measure As
SPResourceMeasure = measures(“CriticalExceptionCount”) 04 05 measure.Update() Which code
segment should you add at line 04?
Which file should you modify?
You use a custom site definition to create SharePoint sites. You need to add a Web Part to the
home page of the site definition. Which file should you modify?
Which class should you use in FeatureReceiver1?
You have a Web application named WebApp1. You have a Feature receiver named
FeatureReceiver1. FeatureReceiver1 stores a connection string in the web.config file of
WebApp1. You need to ensure that when FeatureReceiver1 makes configuration changes to
web.config, the changes are automatically replicated to all Web servers in the farm. Which class
should you use in FeatureReceiver1?
Which line of code should you identify?
You are creating a Web Part for SharePoint Server 2010. The Web Part contains the following
code segment. (Line numbers are included for reference only.) 01 Protected Overloads Overrides
Sub CreateChildControls() 02 MyBase.CreateChildControls() 03
SPSecurity.RunWithElevatedPrivileges(ElevatedCode) 04 05 End Sub 06 Private Sub
ElevatedCode() 07 Dim ListCount As New Label() 08 ListCount.Text = [String].Format (“There are
{0} Lists”, SPContext.Current.Web.Lists.Count) 09 Controls.Add(ListCount) 10 End Sub You need
to identify which line of code prevents the Web Part from being deployed as a sandboxed solution.
Which line of code should you identify?
Which method should you use?
You create a Microsoft .NET Framework console application that uses a Representational State
Transfer (REST) API to query a custom list named Products. The application contains the
following code segment. Dim codc As New AdventureWorksDataContext(New
Uri(“http://contoso/_vti_bin/listdata.svc”)) codc.Credentials = CredentialCache.DefaultCredentials
You need to read all items in Products into an object. Which method should you use?
Which code segment should you add at line 10?
You have a document library named Documents. Minor and major version management is
enabled for the document library. You plan to add a document named MyFile.docx to Documents.
You create a console application that contains the following code segment. (Line numbers are
included for reference only.) 01 Using site As New SPSite(“http://intranet”) 02 Dim documents As
SPList = site.RootWeb.Lists(“Documents”) 03 Dim fstream As FileStream =
File.OpenRead(“MyFile.docx”) 04 Dim content As Byte() = New Byte(fstream.Length – 1) {} 05
fstream.Read(content, 0, CInt(fstream.Length)) 06 fstream.Close() 07
site.RootWeb.Files.Add(documents.RootFolder.Url & “/MyFile.docx”, content, True) 08 Dim file As
SPFile = site.RootWeb.GetFile(documents.RootFolder.Url & “/ MyFile.docx”) 09
file.CheckIn(String.Empty) 10 11 End Using You need to ensure that all users can see the
document. Which code segment should you add at line 10?
Which code segment should you include in the Feature?
You are creating a custom content type named CT1. You need to use a Feature to add an existing
site column named SiteCol1 to CT1. Which code segment should you include in the Feature?
Which code segment should you include in the helper method?
You have a helper method named CreateSiteColumn that contains the following code segment.
Private Shared Sub CreateSiteColumn (ByVal web As SPWeb, ByVal columnName As String)
web.Lists(0).Views(0).ViewFields.Add(columnName) End Sub You need to add a new site column
of type Choice to a SharePoint site by using the helper method. Which code segment should you
include in the helper method?
Which code segment should you add to the application?
You need to create a custom application that provides users with the ability to create a managed
property. The managed property name must be specified in the args[1] parameter. You write the
following code segment for the application. (Line numbers are included for reference only.) 01 Dim
currentSite As New SPSite(“http://intranet”) 02 Dim context As SearchContext =
SearchContext.GetContext(currentSite) 03 Dim schema As New Schema(context) Which code
segment should you add to the application?