Sometimes we can see that when running some Reporting Services report (ie: TS_DeliveryPerformanceWebPart.Report we get error

System.Security.Permissions.SecurityPermission

Aditionaly in Microsoft SQL Reporting Services log you can see following error

ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: , Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for dataset 'ConfirmDateParameterValues'. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.SecurityException: System.Security.Permissions.SecurityPermission at
TS_DeliveryPerformanceWebpart.ConfirmDateDataTable()
The type of the first permission that failed was: System.Security.Permissions.SecurityPermission 
The Zone of the assembly that failed was:
MyComputer

The issue happens because of not correct entry in file rssrvpolicy.config. To fix the problem.

1. Open rssrvpolicy.config

  • If you are using SQL Server 2008, the default location of this file is: \Program Files\Microsoft SQL Server\MSRS10.[SSRSInstanceName]\Reporting Services\ReportServer.
  • If you are using SQL Server 2008 R2, the default location of this file is: \Program Files\Microsoft SQL Server\MSRS10_50.[SSRSInstanceName]\Reporting Services\ReportServer.

2. Double check that entries like (all business logic libraries):

<CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="AX_Reports_Strong_Name" Description="This code group grants Dynamics AX Reports code full trust. ">
             <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718E
 A31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9" />
          </CodeGroup>

<CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="AxSessionPermissionSet">

  <IMembershipCondition class="UrlMembershipCondition" version="1" Url="C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\bin\Vend.BusinessLogic.dll" />

  </CodeGroup>

are located under entry

<IMembershipCondition class="ZoneMembershipCondition" version="1" Zone="MyComputer" />

The problem can occur when you used msdn article: http://technet.microsoft.com/en-us/library/hh389762.aspx as the step 7 in section "Modify the report server RsSrvPolicy.config" we should add the mentioned tag in section:

<CodeGroup class="FirstMatchCodeGroup" version="1" PermissionSetName="Execution" Description="This code group grants MyComputer code Execution permission. ">

              <IMembershipCondition class="ZoneMembershipCondition" version="1" Zone="MyComputer" />

 We are working on changing this article.

You can also open the configuration file from default environment and compare it with the one from changed environment.

 

--author: Jolanta Malkowska, Czesława Langowska Vliegen
--ediror: Czesława Langowska Vliegen