Version of security class in rssrvpolicy.config
When I add a custom assembly to SSRS, I got the following error,
Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
I checked rssrvpolicy.config and Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\security.config,
The one from security.config is,
<
SecurityClass
Name="SqlClientPermission"
Description="System.Data.SqlClient.SqlClientPermission,
System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
but rssrvpolicy.config shows,
<
SecurityClass
Name="SqlClientPermission"
Description="System.Data.SqlClient.SqlClientPermission,
System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
Any idea? Thanks.
Rui
October 18th, 2010 5:56pm
Hi Rui,
The issue you mentioned occurs due the System.Data.SqlClient.SqlClientPermission is not asserted in the custom code.
In order to access data in Microsoft SQL Server tables by using the "System.Data.SQLClient" namespace in a custom assembly, we must add the following code to the custom assembly before we use the "System.Data.SQLClient" namespace:
System.Data.SqlClient.SqlClientPermission pSql = new SqlClientPermission(System.Security.Permissions.PermissionState.Unrestricted);
pSql.Assert();
For more information, please see:
How to grant permissions to a custom assembly that is referenced in a report in Reporting Services:
http://support.microsoft.com/kb/842419
If you have any more questions, please feel free to ask.
Thanks,
Jin Chen
Jin Chen - MSFT
Free Windows Admin Tool Kit Click here and download it now
October 20th, 2010 11:32am