The ASP.NET Capsule #19: Examine “The located assembly’s manifest definition does not match the assembly reference”
Hi all.
Today I got reported from one of our clients that he was having problems printing a report they have. The error he was getting was:
* An error occurred during local report processing.
o The definition of the report ‘Main Report’ is invalid.
+ An unexpected error occurred in Report Processing.
# The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have never seen this error before, and it was odd because everything was working perfectly right yesterday (or so I though).
I’m using Microsoft local reports (RDLC files). The page only has a report viewer which loads a report file with some parameters coming from the query string.
The descriptions I found on the Internet was that the problem is caused by a reference to an assembly with specific version that is not found, but another one named the same with a different version is found.
I went looking into the GAC for the missing assembly, I could not believe this could be the cause, so after checking I found that there were two versions of the Microsoft.Reporting assemblies:
Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.ReportViewer.Design, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.ReportViewer.ProcessingObjectModel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.ReportViewer.ProcessingObjectModel, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.ReportViewer.WebDesign, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.ReportViewer.WinForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.ReportViewer.WinForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
The application is using version 8 of the report viewer and reports definitions, so I was very surprised that the application was not able to find the right assembly, even with the complete definition of version and public token in the Web.Config file.
The worst came when examine a test environment, setup on the same server, connecting to the same database and here it was working.
I just could not believe it.
Well, I checked every single post I found on the Internet until something came up that I haven’t tried yet, so I did it.
I recycled the Application Pool. What?? Yes! After recycling the application pool everything went back to normal.
I’m still trying to figure it out what happened because is not clear to me how the application pool got corrupted in that way. Once I find more (if I do find more) about it I will update this post.
Hope this will help some of you. And if you know more about this error, please comment so others benefit.
Thanks!
Thanks alot! your post saved hours 🙂