SSRS 2008, custom dll, file not found

大兔子大兔子 提交于 2019-12-08 16:05:42

问题


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?


回答1:


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




回答2:


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.




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/4995425/ssrs-2008-custom-dll-file-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!