LocalReport.SetBasePermissionsForSandboxAppDomain Method

Sets the base permissions for the sandboxed application domain with the supplied permission set.

Namespace: Microsoft.Reporting.WebForms
Assembly: Microsoft.ReportViewer.WebForms (in microsoft.reportviewer.webforms.dll)


Public Sub SetBasePermissionsForSandboxAppDomain ( _
    permissions As PermissionSet _
Dim instance As LocalReport
Dim permissions As PermissionSet

public void SetBasePermissionsForSandboxAppDomain (
    PermissionSet permissions
void SetBasePermissionsForSandboxAppDomain (
    PermissionSet^ permissions
public void SetBasePermissionsForSandboxAppDomain (
    PermissionSet permissions
public function SetBasePermissionsForSandboxAppDomain (
    permissions : PermissionSet


  • permissions
    The PermissionSet to set. The default base permission is Execution.


The base permissions in the sandboxed application domain apply to custom code assemblies and the evaluation of report expressions. Note that this method replaces any existing base permission set with the supplied permission set. You should make sure that the supplied permission set includes the Execution permission. Otherwise, no custom code assemblies can be executed and no expressions can be evaluated.

If you change the permissions, make sure that the LocalReport object cannot be used to access any untrusted report definitions. In .NET Framework 3.5 (or in .NET Framework 4 with LegacySecurityPolicy enabled), you must explicitly call the ExecuteReportInSandboxAppDomain method to switch to the sandboxed application domain mode.


The following code adds file input and output permissions to the default base permission set.

PermissionSet permissions = new PermissionSet(PermissionState.None);
permissions.AddPermission(new FileIOPermission(PermissionState.Unrestricted));
permissions.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));

Dim permissions As New PermissionSet(PermissionState.None)
permissions.AddPermission(New FileIOPermission(PermissionState.Unrestricted))
permissions.AddPermission(New SecurityPermission(SecurityPermissionFlag.Execution))


See Also


LocalReport Class
LocalReport Members
Microsoft.Reporting.WebForms Namespace