I have a clickonce app with embedded VB "custom code" for a local rdlc report file. When I deploy this to a file share and then install on a client - I have file IO permission (I can write a text file on the client).
However, when I try to run a report - I get the following exception:
Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.Reporting.DefinitionInvalidException: The definition of the report 'Main Report' is invalid. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
I'm using ExecuteReportInCurrentAppDomain in my code.
reportObject.LocalReport.ExecuteReportInCurrentAppDomain(System.Reflection.
Assembly.GetExecutingAssembly().Evidence);
As I mentioned, I can write to the client. Also, If I publish to my local drive and then install, I don't get any errors when running a report. It seems like there's some security that I'm not granting to the report, specifically FileIO. Can someone shed some light on this?