Visual-studio – Build of project with RDLC cannot find custom assembly

buildcompiler-errorsrdlcreportviewervisual studio

I've been tearing my hair out for three days trying to get an RDLC report to build in VS2010. I want to access a custom assembly from another project in the same solution in an expression for a Text item on a subreport. There is a reference to the assembly in the project containing the RDLC and I added a reference to the assembly DLL in the properties of the subreport, but when I build it I get an error telling me it cannot find the file:

Error while loading code module: ‘CCCArchive, Version=2.0.847.11068, Culture=neutral, PublicKeyToken=null’. Details: Could not load file or assembly 'CCCArchive, Version=2.0.847.11068, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

The RDLC file appears to have no path information for the assembly in the XML and I have tried putting copies of the assembly in the bin\Debug folder under the project containing the RDLC and in the same folder as the RDLC without success.

Judging from what little I have been able to find about this, it appears I may have to register the assembly in the GAC to get the build to work, but I can't find any direct confirmation of that and putting it in the GAC just to get the build to run would be a major nuisance.

Am I missing something?

…Jim Hansen

Best Answer

One possible solution that worked for me is described in this post:

Reporting Services – Custom report error (Error while loading code module: MarketingPilot.Framework.dll)

I copied the assembly referenced in the error message to this folder:

C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies

Doing this I could debug the application without a problem. :)