Could not load file or assembly error on adding custom libraries in SSRS reports

perplexedDev picture perplexedDev · Sep 22, 2015 · Viewed 12.3k times · Source

I have created a custom library(CodeLibrary) which internally references the dlls Microsoft.TeamFoundation.Client and Microsoft.TeamFoundation.WorkItemTracking.Client.

I added this custom Dll codelibrary.dll to my SSRS report. and the expression of one of the field as

=codelibrary.codefunction.GetValue(1000)  

codefunction is the class and GetValue is the method.

When I preview the report, I get the error "Error while loading code module: 'CodeLibrary,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null'. Could not load file or assembly 'CodeLibrary,Version1.0.0.0, Culture=neutral,PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."

I am using VS2013, I have placed the custom library DLL in the path C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies

I have tested the custom library with a WPF application and it works fine.

I am not able to figure out what is causing this error.

Answer

perplexedDev picture perplexedDev · Sep 22, 2015

I didnt have to modify rssrvpolicy.config file. I added the custom dll to the following paths and it worked:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin