Justin
Justin

Reputation: 10907

Problems deploying .rdlc to server. (ie. ReportViewer with local report)

I would like to Publish my web application and view a report with the Microsoft ReportViewer. Everything works locally but when published I've encountered a troubling number of errors. Finally I seem to have come across one that I cannot fix.

So far I have solved the first 3 problems by...

  1. Installing the Miscrosoft Report Viewer Redistributable 2008
    package on my server.
  2. Changed my "rdlc" file to be "Content" and removed the rdlc buildProvider in the web.config file.
  3. Configured the Managed Handler in IIS for the ReportViewer

Finally, the ReportViewer is at least visible and it "seems" to be trying to load the report. BUT Now I'm getting the following error:

[InvalidCastException: Unable to cast object of type 'Microsoft.Reporting.WebForms.ReportHierarchy' to type 'Microsoft.Reporting.WebForms.ReportHierarchy'.] Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +253 Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +669 Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +13
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Oh great! Of course you can't cast an object to the type that it already is!!!! Does anybody know how to fix this one?

Thanks,
Justin

Upvotes: 1

Views: 6730

Answers (3)

Justin
Justin

Reputation: 10907

Well turns out when I did step 3. "Configured the Managed Handler in IIS for the ReportViewer"

I registered the wrong one. The system had a v8.0 and a v9.0. 50-50 odds of picking the wrong one and I won.

Let this be a lesson to people who think dialog boxes don't need to be resizable... THEY ALWAYS SHOULD so you can see the content. The version number is not visible in the dropdown you are staring at 2 identical entries to the eye!!!

Anyways... if you encounter this problem check that you're version in Visual Studio matches your Managed Handler on the report server machine.

Upvotes: 1

user176791
user176791

Reputation:

Do you have .Net 3.5 SP1 installed on the server?

Upvotes: 0

roman m
roman m

Reputation: 26561

If you don't have Visual Studio upgraded to SP1, you need to upgrade as per this MSDN thread.

Upvotes: 0

Related Questions