none
Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib RRS feed

  • Question

  • In my web application i am trying to load the rdlc file by giving a dataset

    RDLC file is been place in my bin folder itself

    I am getting an error below

    The Value expression for the query parameter ‘@ProcessDate’ contains an error: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

    @ProcessDate is the first parameter in hte RDLC file.

    I am able to solve the issue by placing security permission like below

     

    PermissionSet permissions = new PermissionSet(PermissionState

    .None);

    permissions.AddPermission(

    new SecurityPermission(PermissionState

    .Unrestricted));

    permissions.AddPermission(

    new SecurityPermission(SecurityPermissionFlag

    .Execution));

    rptVieiwer.LocalReport.SetBasePermissionsForSandboxAppDomain(permissions);

    

    I want to know why this 4 lines above is required, anyway i am loading the RDLC file from my bin folder

    and also it does not have any custom dll refernce.

    Why security permission is rquired to be set?

     


    Raamakarthikeyan
    Thursday, August 25, 2011 9:52 AM