I have a VS 2010 WebForm application which uses a ReportViewer control and it is running perfectly on the local DevFabric off the SqlAzure database and using SqlAzure Session state (for the ReportViewer).
The application also uses ACS Federation which all works fine both in local DevFabric and in the deployed azure webrole.
The webrole (2 instances) are configured with FullTrust
Now, having added in the ReportViewer and related rdlcs, When I deploy to the cloud I can get the ReportViewer to render but rather than get any data I get an exception as follows :
The Hidden expression for the tablix ‘TimesheetDate’ contains an error: Request for the permission of type ‘System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed.
As I stated, this works perfectly in local DevFabric but fails in Azure webrole (2 instances) on any reports where the Hidden field is used.
Clearly the expression is causing a security issue but as this is Azure I am uncertain about where I can go about changing settings
Anybody have any idea?
EDIT: Just found this as a possible fix:
ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(
new System.Security.PermissionSet(
System.Security.Permissions.PermissionState.Unrestricted));
This fix was utilised in an Azure WebRole and worked fine.
Given that Azure patching is ‘standard’ then it is less likely that a other patches might cause an issue.
The code in the EDIT has been working in a deployed Azure environment since late October 2011