We have a Reporting-Project using the Client-Version of SSRS, the RDLC-Files. To do so, we use the Nuget-Package "Microsoft.ReportViewer.Windows" with the only version avaliable. The File-Version is "11.0.3452.0". Everything works fine, but on ONE Server, when we install the "Microsoft Report Viewer 2012 Runtime CTP" into the GAC, File-Version "11.0.1443.3", these Assemblies are used and SubReports show the message
Error: Subreport could not be shown.
From what I understood, it is the expected behavior, that the gac-assemblies with the same Major-Version are being priorized over the local ones.
Now the interesting Part: I inserted some Debugs to print out all loaded Assemblies:
protected void BtnAssemblies_Click(object sender, EventArgs e)
{
var sb = new StringBuilder();
sb.Append("<br />");
var sbExceptions = new StringBuilder();
sbExceptions.Append("<br />");
var t = new LocalReport();
var reportViewerAssemblies = AppDomain.CurrentDomain.GetAssemblies().ToList();
for(int i = 0; i < reportViewerAssemblies.Count();i ++)
{
var ass = reportViewerAssemblies[i];
try
{
sb.Append(ass.FullName);
sb.Append(": ");
sb.Append(ass.CodeBase);
sb.Append("<br />");
}
catch(Exception ex)
{
sbExceptions.Append(ass.FullName);
sbExceptions.Append("<br />");
}
}
var str = sb.ToString();
str += "<br />";
str += "<br />";
str += sbExceptions.ToString();
LblAssemblies.Text = str;
}
And except the 4 expected assemblies:
- Microsoft.ReportViewer.Common.DLL
- Microsoft.ReportViewer.DataVisualization.DLL
- Microsoft.ReportViewer.ProcessingObjectModel.DLL
- Microsoft.ReportViewer.WinForms.DLL
The loaded assemblies are exactly the same. Since I have no clue, how this can happen, I tried to "fix-up" the problem by overwriting the binding, since I'd like to use the local assemblies anyway. Since it's not possible to redirect the same version, I tried the File-Version:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.ReportViewer.Common.dll" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="11.0.1443.3" newVersion="11.0.3452.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Which also doesn't work. So my questions:
- How is it possible installing a different minor Version in the GAC causes ONE Server to fail?
- Is there any way to find out more about the assemblies loaded? Unfortunately, we don't get an error directly, just a meaningless Message
- As a workaround, is there any possibility to either overrule the GAC or put a redirect on the file-versiob