无法加载文件或程序集Microsoft.ReportViewer.WebForms.XmlSerializers

我在我的aspx页面中使用ReportViewer控件。 我正在从远程处理模式访问报告。

这是我的代码:

ReportServerDomain = System.Configuration.ConfigurationSettings.AppSettings["ReportServerDomain"]; ReportServerUserName = System.Configuration.ConfigurationSettings.AppSettings["ReportServerUserName"]; ReportServerPassword = System.Configuration.ConfigurationSettings.AppSettings["ReportServerPassword"]; String ReportFolder = System.Configuration.ConfigurationSettings.AppSettings["ReportFolderName"]; rptUrl = new Uri(Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings["ReportURL"])); IReportServerCredentials irsc = new CustomReportCredentialsToCreateStatement(ReportServerUserName, ReportServerPassword, ReportServerDomain); ReportViewer1.ServerReport.ReportServerCredentials = irsc; ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; parameters = new ReportParameter[1]; parameters[0] = new ReportParameter("ClientStatementBatchId", ds.Tables["ClientStatemtntBatch"].Rows[0]["ClientStatementBatchID"].ToString()); ReportViewer1.ServerReport.ReportServerUrl = rptUrl; ReportViewer1.ServerReport.ReportPath = "/" + ReportFolder + "/Client Statements"; ReportViewer1.ServerReport.SetParameters(parameters); // i am getting error on this line. ReportViewer1.ServerReport.Refresh(); 

错误是:

无法加载文件或程序集’Microsoft.ReportViewer.WebForms.XmlSerializers,Version = 9.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a’或其依赖项之一。 该系统找不到指定的文件。

任何人都可以帮助我,如何解决这个问题?

谢谢,

D.Bernardin

您是否尝试重新安装ReportViewer可再发行文件? 你可以在这里找到链接

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6576

http://www.microsoft.com/download/en/details.aspx?id=4016

第一个是与VS2008报告查看器相关的(另一个是2005版本),是应该解决问题的一个。

导致此问题的根本原因是Microsft.ReportViewer.Webforms dll的版本问题。 解决方案是下载并从位置http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6576运行exe ReportViewer.exe 。 我们的实际问题是我们的报告相关的dll指向一些旧版本,即不是版本11.0.0.0。 一旦这个exe运行正常,它将正确指向版本11.0.0.0。 要正常工作,请在两个Web配置中进行相同的输入

 " 

和注册区域

 <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>"