SSRS 2008, custom dll, file not found
I've been fighting with SSRS now for a while and it's beyond silly. When I add a reference to a dll (which is part of the same solution) it gives me nothing but a
[rsErrorLoadingCodeModule] Error while loading code module: ‘MyFile.MyClass.Code, Version开发者_开发百科=1.0.0.0, Culture=neutral, PublicKeyToken=null’. Details: Could not load file or assembly 'MyFile.MyClass.Code, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
I've tried hitting the solution config to tell it debug source is in other locations, copying the file to about 50 different locations (not gac, not possible), running Visual Studio 2008 as admin, all the goofy stuff you can think of ... nothing, same error everytime.
Any ideas?
Here is the actual correct answer.. I've had to fight with this twice now and did not document it well enough the first time thinking it was a one-time thing.
Putting it in the SQL Server Bin folder is for the server. for DEVELOPMENT put a copy in the Visual Studio folder,
something like: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies
or Windows 7 64 bit C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies
I got a similar error on ssrs-2005.
Just manually copy your dll to the following report server folder: "C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin" and everything should work fine.
You may need to add references to the assemblies that your MyFile assembly itself references. So, if MyFile references System.IO for example, you may need to add that dll reference explicitly to the report.
For those who have been having trouble with custom dlls which import System.Data.SqlClient, I found the following tip absolutely essential in the rssrvpolicy.config file:
Short and dirty answer: Change the PermissionSetName attribute from "Execution" to "FullTrust" for CodeGroup "Report_Expressions_Default_Permissions".
I hope this helps someone.
精彩评论