View Count: 0
Duration: 45 mins
Accessed date:
Not Yet Viewed
Post your comment / feedback here

Be the first one to comment about this video

Sorry!For this module there is no Sample Code.
Sorry!For this module there is no Assignments.
Question No: 1 of 1
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 override void CreateChildControls() {
02 base.CreateChildControls();
03 SPSecurity.RunWithElevatedPrivileges (ElevatedCode ());
05 }
06 private void ElevatedCode() {
07 Label ListCount = new Label ();
08 ListCount. Text = String. Format ("There are {0} Lists",  SPContext.Current.Web.Lists.Count);
09 Controls.Add (ListCount);
10 }
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? 
  1. 02
  2. 03
  3. 08
  4. 09
View Answer/Explanation:
Calls from sandboxed solutions to APIs in SharePoint assemblies, other than Microsoft.SharePoint.dll, are subject to the same restrictions as any other calls from sandboxed solutions: only assemblies with the AllowPartiallyTrustedCallersAttribute can be called, only assemblies in the general assembly cache (GAC) may be called, and all APIs that are called are subject to the CAS policy and the restricted security token of the sandboxed worker process. For more information, see Restrictions on Sandboxed Solutions and Available and Unavailable SharePoint Assemblies from Sandboxed Solutions.RunWithElevatedPrivileges is not supported in Sandboxed Solutions