Re: Security exception when calling custom code from a report.
Mark Magnusson
I have also run into this problem, and have tried everything i can find to resolve this situation however i am still coming up dry.
Background info:
I have designed and tested a report using a custom assembly in Visual Studio 2005. The report runs perfectly in Visual Studio.
I uploaded the report to the report server, in the following directory:
C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin
At this point i was able to access the report and run it fine from within the web report viewer of Microsoft CRM (the application that the report was designed for use with) however certain elements of the report would not render. I noticed that the elements in question are ones that rely on my custom assembly ( which accesses data from an SQL database running on the same SQL server as reporting services ).
I then tracked that issue to the fact that my custom assembly was not signed and strongly named, and therefore didnt have the permissions required to access the SQL server data. So i generated a key and signed the assembly.
I tried placing the assembly in the GAC after signing it, however when running the report it claimed that it could not find the assembly file, so i moved it back into the bin directory of the reporting server.
Now when running the report i get the error: "Failed to load expression host assembly. Details: That assembly does not allow partially trusted callers. (rsErrorLoadingExprHostAssembly)"
At this point i have hit a dead end, i need to find a solution to this issue as this report needs to be run from our local intranet. Any help on this would be greatly appriciated, thanks in advance.