Sunday, February 19, 2012

Custom assembly, not a trusted assembly

When I add a reference to my custom assembly to the report and try to preview it I get the following error message:
Parameters Error

The report references the code module ‘Employee, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null’, which is not a trusted assembly.

OK
I have modifed the reporting services rspreviewpolicy.config and rssrvpolicy.config with the following:

<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="Custom_Code_Group"
Description="This code group grants custom code full trust. ">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies\Employee.dll"
/>
</CodeGroup>
However it has made no difference. I know I must be missing something. Can anyone point me in the right direction.

Thank you in advance.I just upgraded from RS 2005 Beta 1 to Beta 2. Now I'm having the same problem. I had all of my custom assemblies working fine in Beta 1. When I installed Beta 2, I gleaned from a few postings that I had to move my assemblies to

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies

Done.

I then modified RSPreviewPolicy.config in the same folder to give access to these assemblies.

<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="SystemCommon"
Description="Grants permissions to the User Utilities assembly">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\et.User.SystemCommon.dll"
/>
</CodeGroup>

Doesn't work.

"The report references the code module 'et.User.SystemCommon' .... , which is not a trusted assembly."

Question : are there any significant changes to Code Access Security from Beta 1 to Beta 2? In Beta 1, if you did anything wrong in the config file (ie "URLMembershipCondition" vs. "UrlMembershipCondition"), the whole IDE gave out. I'm wondering if perhaps this is a more subtle way of telling me the same thing?

Significantly, the reports are working fine on the server.

I'ma go getta coffee.|||There was a problem with custom assemblies in some of the earlier builds. Your solution should work for the released version.

No comments:

Post a Comment