The @StefanHa comment gives the answer, in case the blog post disappears here the code that worked for me:
using System.Reflection; using System.Security; using System.Security.Permissions; using System.Security.Policy; PermissionSet permissions = new PermissionSet(PermissionState.None); permissions.AddPermission(new FileIOPermission(PermissionState.Unrestricted)); permissions.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); rv.LocalReport.SetBasePermissionsForSandboxAppDomain(permissions); Assembly asm = Assembly.Load("MyLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"); AssemblyName asm_name = asm.GetName(); rv.LocalReport.AddFullTrustModuleInSandboxAppDomain(new StrongName(new StrongNamePublicKeyBlob(asm_name.GetPublicKeyToken()), asm_name.Name, asm_name.Version));
I also needed to set PermissionState.Unrestricted instead of PermissionState.None. In my example, I downloaded System.Web + System.Drawing and so I only needed to SetBasePermissionsForSandboxAppDomain .
source share