Microsoft Report Viewer Problem

MS Report Viewer Error
MS Report Viewer Error

One of my pet peeve’s in software development is Microsoft’s Reports. The other day I was minding my own business and up popped this error while I was moving some files around on the server.


Could not load file or assembly ‘Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.

The full error displayed was:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3)

SOURCE: mscorlib
OBJECT TYPE: System.IO.FileNotFoundException
MESSAGE: Could not load file or assembly ‘Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.

STACKTRACE: at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)


The problem was that I had failed to put the report viewer files in the bin folder. These files are as follows:

    1. Microsoft.ReportViewer.ProcessingObjectModel.dll
    2. Microsoft.ReportViewer.Common.dll
    3. Microsoft.ReportViewer.WebForms.dll

(I also have files 2 & 3 in that folder.)

Solution
What you have to do is copy the “Microsoft.ReportViewer.ProcessingObjectModel.dll” file
to the “bin” folder in the web site application folder in the IIS server. Usually this is where you load your files to, just in the “bin” folder off the root.

Once I put those files in the bin folder of the web site on the server, all was well again, and I could go back and sip my latte.

Cheers!