From: Dan Booksta on
I'm trying to debug a custom assembly written in C# to use with an SSRS
report. If I preview the report in the visual studio everything previews just
fine. When I try to debug it by pressing F5 I get the following error in
internet explorer where the report should be:

Failed to load expression host assembly. Details: That assembly does not
allow partially trusted callers. (rsErrorLoadingExprHostAssembly)

I have done the following things to try to fix this:

1) Include the attribute in my AssemblyInfo.cs: [assembly:
AllowPartiallyTrustedCallers()]
2) Add the following code group to the RSPreviewPolicy.config and
RSServer.config file:

<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="FunctionLibrary"
Description="Custom FunctionLibrary Code Group">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files
(x86)\Microsoft Visual Studio
8\Common7\IDE\PrivateAssemblies\FunctionLibrary.dll"
/>
</CodeGroup>

3) Change the default permissions for the code group in general:

<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="Report_Expressions_Default_Permissions"
Description="This code group grants default
permissions for code in report expressions and Code element. ">
<IMembershipCondition
class="StrongNameMembershipCondition"
version="1"

PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100512C8E872E28569E733BCB123794DAB55111A0570B3B3D4DE3794153DEA5EFB7C3FEA9F2D8236CFF320C4FD0EAD5F677880BF6C181F296C751C5F6E65B04D3834C02F792FEE0FE452915D44AFE74A0C27E0D8E4B8D04EC52A8E281E01FF47E7D694E6C7275A09AFCBFD8CC82705A06B20FD6EF61EBBA6873E29C8C0F2CAEDDA2"
/>
</CodeGroup>

Nothing seems to work. Please help! Thanks