Could not load file or assembly Microsoft.ReportViewer.WebForms.XmlSerializers
Asked Answered
H

2

8

i am using ReportViewer control in my aspx page. i am accessing the report from remote processing mode.

this is my code:

      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();

The error is:

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

Can any one help me , how to solve this issue?

Thanks,

D.Bernardin

Horowitz answered 21/9, 2011 at 4:31 Comment(1)
please check this question and all answers here in SO: #4396646Maladapted
C
16

Have you tried to reinstall ReportViewer redistributable files? You can find the links here

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

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

The first one is the one related to VS2008 report viewer, ( the other one is for 2005 version) and is the one that should resolve your problem.

Centripetal answered 21/3, 2012 at 16:39 Comment(0)
S
0

Root cause for this issue is version problem of Microsft.ReportViewer.Webforms dll. Solution is down load and run the exe ReportViewer.exe from the location http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6576. Our actual problem is our report related dll is pointing to some old version ie not to version 11.0.0.0. Once this exe got run properly it will be properly pointing to version 11.0.0.0. To work it properly make same entry in both web config

<add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, 
Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>" 

and registering area also

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, 
Culture=neutral, PublicKeyToken=89845dcd8080cc91"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>"
Steamboat answered 8/8, 2017 at 11:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.