home screen

Search



Number Of Result : 0

Result :


Monday, August 8, 2011

Issue in LINQ to Sharepoint 2010

You see this error, when you try to retrieve an item or many item in LINQ ( context.List.ScopeToFolder("",true).FirstOrDefault() or context.List.ScopeToFolder("",true).ToList() ... ):
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
please turn on BrowseDirectories role
public static void UpdateReadPermissionLevel(SPWeb web)
{
SPRoleDefinition role = web.RoleDefinitions["Read"];
role.BasePermissions = role.BasePermissions | SPBasePermissions.BrowseDirectories;
role.Update();
}

1 comment:

Binh Luong said...

good ..good..Thank you