Recently, when referencing a custom DLL in a SSRS 2008 report, I encountered the following error while previewing the reports -
[rsErrorLoadingCodeModule] Error while loading code module: ‘MyDLL, Version=1.0.7894.64724, Culture=neutral, PublicKeyToken=fa4fdc82edbae8ac7’. Details: Could not load file or assembly ‘MyDLL, Version=1.0.7894.64724, Culture=neutral, PublicKeyToken=fa4fdc82edbae8ac7′ or one of its dependencies. The system cannot find the file specified.
Although I had the DLL file in the Report Server’s bin folder, Reporting Services still complained that it could not find the file. This is because it looks for custom assembly in two locations – one meant for Report Designer and another for Report Server.
For Report designer, Reporting Services looks for the DLL in –
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies (if using SQL Server 2008) OR
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies (if using SQL Server 2005)
And for Report Server it looks at –
C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin
After I copied the DLL in the PrivateAssemblies folder, I was able to preview the report without any errors.